Repository navigation
Python: fix(bedrock): keep reasoning content so extended thinking works with tool calls - #8936
Conversation
…ks with tool calls
|
/review |
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: Findings reported
Scope: full PR (1 commit(s)): 6b49c10fe5ea
Model: gpt-5.6-sol
Overview
The change maps Bedrock reasoning text and signatures into text_reasoning, preserves their order with tool calls, and replays signed reasoning only from assistant messages. The new tests cover non-streaming parsing, single-block streaming aggregation, replay shape, and role gating. Streaming still loses reasoning-block boundaries when a response contains consecutive reasoning blocks, which can pair modified text with the wrong signature during tool-result continuation.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
1 verified finding remained after source verification (1 medium) across 1 file. Details are attached to the affected lines below.
Affected areas: python/packages/bedrock/agent_framework_bedrock/_chat_client.py
…soning blocks separate
Motivation
BedrockChatClientwas not handlingreasoningContentproperly. Because of this, reasoning was not shown, and tool calls with extended thinking could fail because the required reasoning signature was missing.Changes
reasoningContenttotext_reasoning.protected_data.text_reasoningback toreasoningContentin requests.ConverseStream.Impact
Reasoning is now available to callers, and extended thinking with tool calls should work correctly. Non-reasoning requests are unchanged.
Testing
redactedContentis still not handled.Related Issue
Fixes #8935
Checklist