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
bug(strands): normalize public reasoning and keep Agent output final-only #282
Strands exposes provider-public reasoning as reasoningContent.reasoningText.text. The instrumentation currently passes the raw SDK block into GenAI messages:
This is missing the shared message-part discriminator. It should become:
{"type":"reasoning","content":"synthetic plan"}
The Agent invocation also reuses the model-output converter, so its final output includes the final model's reasoning alongside the answer. Agent output should describe the final result; intermediate reasoning, tool plans and tool results belong to the model/tool spans.
Reproduction and evidence
Using Strands 1.60.0 with the real Agent.invoke_async / Agent.stream_async loop, a deterministic provider, reasoning deltas and actual tool dispatch:
Two user turns per session, multiple model decisions and concurrent sessions reproduce both defects.
A complex SDK-backed application produces 18 raw reasoning blocks on 18 LLM spans and reasoning in all 6 Agent outputs.
Streaming and non-streaming regression assertions fail before the fix. Changing only reasoning conversion still leaves the Agent boundary assertion failing.
The application's final answers, SDK messages and tool results are otherwise correct.
These defects predate the separate stream lifecycle fix in #278.
Expected behavior
Normalize public reasoning text in model inputs and outputs through the shared Reasoning type.
Exclude reasoning signatures, encrypted/redacted reasoning and unavailable text from telemetry.
Keep Agent output limited to final result parts, preserving final multimodal parts.
Preserve original SDK responses, stream results, tools, usage and context behavior.
Apply the same message semantics to span and structured log-event capture.
A focused follow-up fix and regression tests are being prepared.
Activity