Fix Bedrock replay of historical tool names#181
Merged
Conversation
Map every historical canonical tool identifier through the request-scoped Bedrock name table so resumed turns cannot emit provider-invalid names.
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.
Summary
tool_useblock to use that map instead of falling back to the raw canonical nameWhy
A resumed agent can retain a valid historical tool call after that tool leaves the current turn's catalog. Canonical names commonly contain dots, while Bedrock only accepts
[a-zA-Z0-9_-]+. Replaying the canonical name unchanged therefore produced a providerValidationExceptionand failed otherwise valid multi-step runs.This keeps the ownership boundary explicit: transcripts remain canonical, and the Bedrock adapter performs all provider-specific name translation.
Test plan
make lintmake test