Skip to content

Fix Bedrock replay of historical tool names#181

Merged
raphael merged 1 commit into
mainfrom
fix/bedrock-historical-tool-names
Jul 13, 2026
Merged

Fix Bedrock replay of historical tool names#181
raphael merged 1 commit into
mainfrom
fix/bedrock-historical-tool-names

Conversation

@raphael

@raphael raphael commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

  • build one request-scoped Bedrock name map from both advertised tools and canonical tool names already present in transcript history
  • require every historical tool_use block to use that map instead of falling back to the raw canonical name
  • reject sanitized-name collisions before sending the provider request

Why

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 provider ValidationException and 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 lint
  • make test
  • regression coverage for a history-only dotted name
  • regression coverage for collisions between current and historical names

Map every historical canonical tool identifier through the request-scoped Bedrock name table so resumed turns cannot emit provider-invalid names.
@raphael
raphael merged commit 2f26eb4 into main Jul 13, 2026
2 checks passed
@raphael
raphael deleted the fix/bedrock-historical-tool-names branch July 13, 2026 17:28
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.

1 participant