Skip to content

Conversation

@pgrayy
Copy link
Member

@pgrayy pgrayy commented Oct 8, 2025

Description

Bedrock model requests will fail if messages contain any tool use or tool result blocks and no toolConfig is provided. To demonstrate, you can run the following script:

from strands import Agent

agent = Agent(
    messages=[
        {
            "role": "user",
            "content": [
                {
                    "text": "What is the current time in New York."
                },
            ],
        },
        {
            "role": "assistant",
            "content": [
                {
                    "toolUse": {
                        "input": {
                            "city": "New York",
                        },
                        "name": "current_time",
                        "toolUseId": "t1",
                    },
                },
            ],
        },
        {
            "role": "user",
            "content": [
                {
                    "toolResult": {
                        "content": [
                            {
                                "text": "12:31",
                            },
                        ],
                        "status": "success",
                        "toolUseId": "t1",
                    },
                },
            ],
        },
    ],
)
agent("Please summarize this conversation.")

This will result in the following error:

botocore.errorfactory.ValidationException: An error occurred (ValidationException) when calling the ConverseStream operation: The toolConfig field must be defined when using toolUse and toolResult content blocks.

This is problematic for our summarization manager when configured with a bedrock agent that uses no tools. To fix, I am adding a noop tool to the agent tool registry when no tools are configured.

Related Issues

#998

Documentation PR

N/A

Type of Change

Bug fix

Testing

How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli

  • I ran hatch run prepare: Wrote new unit tests
  • hatch test tests_integ/test_summarizing_conversation_manager_integration.py: Wrote new integ tests.

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

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

@pgrayy pgrayy marked this pull request as ready for review October 8, 2025 02:45
@JackYPCOnline JackYPCOnline enabled auto-merge (squash) October 9, 2025 18:47
@JackYPCOnline JackYPCOnline merged commit 9632ed5 into strands-agents:main Oct 9, 2025
24 of 26 checks passed
@pgrayy pgrayy deleted the fix-summarization branch October 24, 2025 14:07
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.

4 participants