AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Bedrock Converse `Content_blocks` Drops Redacted Reasoning Blocks In `Output_version="V1"`

The `_convert_to_v1_from_converse` translator in langchain-core drops redacted reasoning content blocks (e.g., from GPT-6 Sol/Luna/Astra via Bedrock), causing loss of reasoning context in multi-turn conversations when using `output_version="v1"`. This leads to the next turn not sending back the reasoning, potentially degrading model performance.

highConfidence 95%LangChainAffected V1.6.4

Origin Analysis

The `reasoning_content` branch in `_convert_to_v1_from_converse` only handles `text` and `signature` fields, ignoring `redacted_content`. When a block contains only `redacted_content` (opaque encrypted reasoning), the branch produces an empty `reasoning` block or drops it entirely, rather than falling through to the `non_standard` block handler.
1. Construct an AIMessage with content containing a reasoning_content block with redacted_content bytes and model_provider 'bedrock_converse'. 2. Call `msg.content_blocks` and observe it returns `{'type': 'reasoning'}` without the original bytes. 3. In a multi-turn chat with Bedrock Converse and `output_version='v1'`, the second turn's request omits the reasoningContent block.

Fixing Code Block

Edge Case Audit

This change preserves redacted reasoning as non_standard blocks, but may affect serialization or deserialization in older LangChain versions that do not expect non_standard blocks with reasoning_content. Rollback is straightforward: revert to the original single condition. Ensure tests cover AIMessage and AIMessageChunk, and verify that downstream consumers of non_standard blocks handle the new shape. No concurrency or multithreading risks identified.

Ecosystem Topology