From b3efc0fcf2b300f7397477f3e598f87d447acd1b Mon Sep 17 00:00:00 2001 From: yucheng-berri <293926326+yucheng-berri@users.noreply.github.com> Date: Tue, 20 Oct 2026 15:03:22 -0700 Subject: [PATCH] fix(agentcore): say why the end-of-stream flags rebind --- litellm/llms/bedrock/chat/agentcore/transformation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/litellm/llms/bedrock/chat/agentcore/transformation.py b/litellm/llms/bedrock/chat/agentcore/transformation.py index b3706b6c4e8..afe7f8872fe 100644 --- a/litellm/llms/bedrock/chat/agentcore/transformation.py +++ b/litellm/llms/bedrock/chat/agentcore/transformation.py @@ -560,8 +560,8 @@ class AmazonAgentCoreConfig(BaseConfig, BaseAWSLLM): Internal sync generator that parses SSE and yields ModelResponse chunks. """ buffer = "" - sent_finish = False - message_stopped = False # runtimes that send no metadata or final message end on messageStop + sent_finish = False # rebind-ok: flips when a finish chunk goes out + message_stopped = False # rebind-ok: flips on messageStop, the only end some runtimes send for text_chunk in response.iter_text(): buffer += text_chunk @@ -790,8 +790,8 @@ class AmazonAgentCoreConfig(BaseConfig, BaseAWSLLM): Internal async generator that parses SSE and yields ModelResponse chunks. """ buffer = "" - sent_finish = False - message_stopped = False # runtimes that send no metadata or final message end on messageStop + sent_finish = False # rebind-ok: flips when a finish chunk goes out + message_stopped = False # rebind-ok: flips on messageStop, the only end some runtimes send async for text_chunk in response.aiter_text(): buffer += text_chunk