Skip to content

Conversation

liustve
Copy link
Contributor

@liustve liustve commented Jul 23, 2025

Description of changes:

This PR applies temporary patches to address critical bugs in the AWS Bedrock runtime botocore instrumentation (version 0.54b0) that affect tool use functionality in non-streaming responses reported in: strands-agents/sdk-python#488

These changes are temporary patches and should be removed once we upgrade to opentelemetry-instrumentation-botocore version 0.56b0, which includes official fixes for these issues.

See:
open-telemetry/opentelemetry-python-contrib#3548
open-telemetry/opentelemetry-python-contrib#3544

Testing Done

  • Unit tests added
  • Validated with Bedrock AgentCore team that fixes work.
  • Ran a sample app with Bedrock AgentCore and strands framework and validated that expected toolUse output is correct:

Before fix:

Tool use: {"input": ""}
Tool use: {"input": "{\"input\": 99"}
Tool use: {"input": 999}
Tool use: {"input": 99999}
Tool use: {"input": 9999}
Tool use: {"input": 9999}
Tool use: {"input": ", \"input2"}
Tool use: {"input": "\": 8"}
Tool use: {"input": 888888888888}
Tool use: {"input": 888}
Tool use: {"input": "88}"}

After fix:

Tool use: {"input": ""}
Tool use: {"input": "{\"in"}
Tool use: {"input": "put\": 9"}
Tool use: {"input": "99"}
Tool use: {"input": "99"}
Tool use: {"input": "99"}
Tool use: {"input": "9999"}
Tool use: {"input": "99999"}
Tool use: {"input": "99"}
Tool use: {"input": ", \"input"}
Tool use: {"input": "2\":"}
Tool use: {"input": " 8"}
Tool use: {"input": "888888"}
Tool use: {"input": "888888888"}
Tool use: {"input": "88}"}

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@liustve liustve requested a review from a team as a code owner July 23, 2025 23:31
@liustve liustve marked this pull request as draft July 23, 2025 23:32
@liustve liustve marked this pull request as ready for review July 24, 2025 23:22
@liustve liustve changed the title [WIP] Patch BedrockRuntime Converse Stream Fix Patch BedrockRuntime Converse Stream Fix Jul 25, 2025
@liustve liustve merged commit b75ef99 into main Jul 25, 2025
13 checks passed
@liustve liustve deleted the bedrock-converse-fix branch July 25, 2025 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants