From 9e498a9b293e44060931c231b48d7f6a4711f28e Mon Sep 17 00:00:00 2001 From: Dibyanshu Shekhar Date: Thu, 5 Mar 2026 08:54:14 +0000 Subject: [PATCH] Fix has_tool_use tracking in streaming to also check contentBlockDelta for tool use events --- src/strands/models/bedrock.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/strands/models/bedrock.py b/src/strands/models/bedrock.py index 4a48d7229..4540b4c0e 100644 --- a/src/strands/models/bedrock.py +++ b/src/strands/models/bedrock.py @@ -835,6 +835,9 @@ def _stream( if "contentBlockStart" in chunk and chunk["contentBlockStart"].get("start", {}).get("toolUse"): has_tool_use = True + if "contentBlockDelta" in chunk and chunk["contentBlockDelta"].get("delta", {}).get("toolUse"): + has_tool_use = True + # Fix stopReason for streaming responses that contain tool use if ( has_tool_use