You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python: [Bug]: BedrockChatClient drops reasoningContent, so extended thinking with tool calls fails #8935
BedrockChatClient currently ignores reasoningContent in Converse responses, streaming responses, and conversation history. Because of this, the model's reasoning is not returned as text_reasoning. This causes an issue with extended thinking and tool calls: when sending the next request after a tool call, the signed reasoning block is missing. Bedrock requires this block to be sent back along with the tool_use block, otherwise the request can fail.
Code Sample
client = BedrockChatClient(model="anthropic.claude-sonnet-4-...")
response = client._process_converse_response({
"output": {"message": {"role": "assistant", "content": [
{"reasoningContent": {"reasoningText": {"text": "Need the tool.", "signature": "sig"}}},
{"toolUse": {"toolUseId": "call-1", "name": "get_weather", "input": {}}},
]}},
})
print([c.type for c in response.messages[0].contents])
# ['function_call'] <- the reasoning block is lost
Error Messages / Stack Traces
No error at parse time. The reasoning is silently dropped, and the follow-up Converse call after a tool call is rejected by Bedrock when extended thinking is enabled.
🤖 Automated triage reproduction notes(agent-authored — trust but verify)
Agent analysis
Repro: python/packages/bedrock/agent_framework_bedrock/_chat_client.py::_parse_message_contents drops reasoningContent.reasoningText when it accompanies toolUse, leaving only function_call. Minimal repro: pass the issue payload to _process_converse_response and assert content types are text_reasoning and function_call; the added test fails with actual ['function_call']. _process_converse_stream_event and _convert_content_to_bedrock_block likewise contain no reasoning handling.
Activity
github-actions commentedon Oct 1, 2026
🤖 Automated triage reproduction notes (agent-authored — trust but verify)
Agent analysis
Repro:
python/packages/bedrock/agent_framework_bedrock/_chat_client.py::_parse_message_contentsdropsreasoningContent.reasoningTextwhen it accompaniestoolUse, leaving onlyfunction_call. Minimal repro: pass the issue payload to_process_converse_responseand assert content types aretext_reasoningandfunction_call; the added test fails with actual['function_call']._process_converse_stream_eventand_convert_content_to_bedrock_blocklikewise contain no reasoning handling.python/packages/bedrock/tests/test_bedrock_client.pyagent-framework-core 1.19.0agent-framework-bedrock 1.0.0b260918