Repository navigation
fix(strands): normalize reasoning and Agent output boundaries - #283
Merged
Merged
Conversation
github-actions
Bot
requested review from
123liuziming,
Cirilla-zmh and
ralf0131
October 22, 2026 05:45
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No outstanding review issues are identified, and the change is scoped to the documented reasoning normalization and final-response telemetry behavior.
No open issues 🎉
What changed in this PR
This pull request normalizes Strands reasoning content into shared GenAI Reasoning parts and limits Agent output telemetry to final response content without mutating SDK results.
Changes:
- Convert public reasoning text while omitting signatures, redacted content, and unavailable text.
- Filter reasoning, tool calls, and tool results from Agent output while preserving final multimodal parts.
- Add regression tests and document the updated telemetry behavior.
| File | Summary |
|---|---|
instrumentation-loongsuite/loongsuite-instrumentation-strands/tests/test_instrumentor.py |
Adds coverage for reasoning normalization, streaming, privacy filtering, Agent output boundaries, SDK-result preservation, and multimodal content. |
instrumentation-loongsuite/loongsuite-instrumentation-strands/src/opentelemetry/instrumentation/strands/_hooks.py |
Implements reasoning conversion and final-only Agent output mapping. |
instrumentation-loongsuite/loongsuite-instrumentation-strands/README.md |
Documents reasoning normalization and Agent output semantics. |
instrumentation-loongsuite/loongsuite-instrumentation-strands/CHANGELOG.md |
Records the telemetry behavior fixes. |
Review effort: Lite
ralf0131
approved these changes
Oct 29, 2026
ralf0131
approved these changes
Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Strands reasoning blocks currently reach GenAI messages as raw SDK dictionaries without a
type, and Agent output includes the final model's reasoning alongside its answer. Normalize provider-public reasoning through the sharedReasoningtype in model inputs/outputs and filter intermediate reasoning/tool parts from Agent output.Signatures, redacted/encrypted reasoning and unavailable text are omitted from telemetry. Final multimodal parts are retained, and SDK messages/results are left unchanged. README and CHANGELOG document the behavior.
Fixes #282
Type of change
How Has This Been Tested?
tox -c tox-loongsuite.ini -e py312-test-loongsuite-instrumentation-strands-oldest— Strands 1.50.2 / OTel 1.37.0: 46 passed, 2 skipped (framework has no invocation-baggage feature).tox -c tox-loongsuite.ini -e py312-test-loongsuite-instrumentation-strands-latest— Strands 1.62.0 / OTel 1.45.1: 48 passed.PRE_COMMIT_HOME="$(mktemp -d /tmp/loongsuite-precommit.XXXXXX)" tox -e precommitgit diff --checkValidation Evidence
c27eb2a6d8f2ece92b0f315025697b5771a30fd5, head97a68ffb053b3fdc58cccd405934213862420a5b. Rebased over #278/#280; the entire Strands tree is identical to the runtime-tested baseline/patch respectively. Python 3.12.15; real SDK workload uses Strands 1.60.0, OpenAI 1.55.3 and OTel 1.45.1. Dependency boundary tests additionally cover Strands 1.50.2 and 1.62.0.ca3ed46053701c1af48d857864523915ce6bf637confirms extraction of public reasoning text. A bounded OpenLLMetry tree search at8d9c93f37b352131f5871dcb6ecf5e79c19aeb40found no corresponding Strands implementation.The committed regression can be reproduced with the focused tox commands above. The additional SDK/exporter/cloud workload and readback artifacts are retained with the review; they use a deterministic provider boundary and do not claim validation of a remote model service or cloud log ingestion.
Does This PR Require a Core Repo Change?
Checklist: