Skip to content

fix: merge consecutive toolResult blocks into single user message#3957

Merged
Wendong-Fan merged 2 commits intomasterfrom
bedrock_fix
Mar 22, 2026
Merged

fix: merge consecutive toolResult blocks into single user message#3957
Wendong-Fan merged 2 commits intomasterfrom
bedrock_fix

Conversation

@Wendong-Fan
Copy link
Copy Markdown
Member

@Wendong-Fan Wendong-Fan commented Mar 22, 2026

from #3956

Fixes #3954

AWS Bedrock Converse API requires that all toolResult blocks corresponding to a multi-tool-use assistant turn are grouped in a single immediately-following user message. The current code creates a separate user message per tool result, which causes:

botocore.errorfactory.ValidationException: An error occurred (ValidationException)
when calling the Converse operation: Expected toolResult blocks at messages.2.content
for the following Ids: tooluse_bRX9ftpYK3xO5tev2x4qtc

also release 0.2.90

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 22, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 06601c7a-d8a9-4172-b6cc-37d224643982

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bedrock_fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can generate a title for your PR based on the changes with custom instructions.

Set the reviews.auto_title_instructions setting to generate a title for your PR based on the changes in the PR with custom instructions.

@github-actions github-actions Bot added the Review Required PR need to be reviewed label Mar 22, 2026
@Wendong-Fan Wendong-Fan added this to the Sprint 50 milestone Mar 22, 2026
@Wendong-Fan Wendong-Fan self-assigned this Mar 22, 2026
@Wendong-Fan Wendong-Fan removed the Review Required PR need to be reviewed label Mar 22, 2026
@Wendong-Fan Wendong-Fan marked this pull request as ready for review March 22, 2026 08:34
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization's overage spend limit has been reached.

Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit in Settings → Usage.

Once credits are available, reopen this pull request to trigger a review.

@Wendong-Fan Wendong-Fan merged commit deb286f into master Mar 22, 2026
11 of 12 checks passed
@Wendong-Fan Wendong-Fan deleted the bedrock_fix branch March 22, 2026 08:34
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.

[BUG] AWS Bedrock Converse tool calling fails with ValidationException for toolResult

1 participant