Conversation
|
Claude finished @joeyorlando's task in 3m 19s —— View job PR Review: Bedrock tool name encodingReviewed the changes to
SummarySolid fix. The PR correctly addresses Bedrock's 64-char tool name limit via deterministic hash-suffix truncation, applies the encoding consistently across tool definitions, Nothing blocking — a few observations and minor nits below. Observations1. Hash-suffix collisions are not retried (
With 32 bits of hash entropy, the birthday bound is ~65K tools before ~50% chance of any collision, so this is largely theoretical. Still, a defensive loop (or let candidate = encodedName;
if (usedNames.get(candidate) && usedNames.get(candidate) !== originalName) {
candidate = appendToolNameHash(encodedName, originalName);
// Optional: guard against hash-suffix collisions too
let salt = 0;
while (usedNames.has(candidate) && usedNames.get(candidate) !== originalName) {
candidate = appendToolNameHash(encodedName, `${originalName}#${++salt}`);
}
}2. The WeakMap is keyed on the request object identity. In practice:
So for streaming requests the context is built twice (once for the mapping in the stream adapter, once for the actual send), and for non-streaming it's built once (the
3. Previously the mapping was only built for Nova models. Now it's built for every Bedrock request. This is correct (since non-Nova models can also exceed the 64-char limit), and the cost is O(tools) with small constants, so fine. Worth noting in case there's a very hot path — a quick early-exit when no tool name needs encoding could skip map allocation entirely, but probably not worth it. 4. Exporting CLAUDE.md has a "No Premature Exports" rule. This export is only used in 5. Decoding path for assistant history in
6. Test coverage gaps The new tests are focused and well-written. A few cases that would increase confidence:
7. The spread of Minor nits
Correctness & security
VerdictLGTM with optional hardening around hash-suffix collision retry and a suggestion to either realize or drop the Fix collision retry → |
🤖 I have created a release *beep* *boop* --- ## [1.2.10](platform-v1.2.9...platform-v1.2.10) (2026-04-11) ### Features * make posthog analytics configurable ([#3707](#3707)) ([7ae9101](7ae9101)) ### Bug Fixes * `/llm/costs` table scrolling ([#3722](#3722)) ([6a42ba8](6a42ba8)) * apply MCP OAuth lifetime for gateway slugs ([#3711](#3711)) ([362aaec](362aaec)) * Bedrock tool name encoding ([#3706](#3706)) ([0e2c2d1](0e2c2d1)) * costs timeframes and surface limit reset settings ([#3709](#3709)) ([6e4154b](6e4154b)) * jira oauth discovery overrides ([#3721](#3721)) ([2c4cf8f](2c4cf8f)) * OIDC discovery trusted origins for IdP registration ([#3714](#3714)) ([adb5f5e](adb5f5e)) * preserve shared chat agents on fork ([#3715](#3715)) ([252edfc](252edfc)) * reranker model dropdown labels ([#3704](#3704)) ([ebd1c8a](ebd1c8a)) * session logs loading state ([#3712](#3712)) ([ffba126](ffba126)) ### Miscellaneous Chores * **ci:** add ID-JAG MCP e2e test ([#3702](#3702)) ([1a5078a](1a5078a)) * **deps:** bump next from 16.1.7 to 16.2.3 in /platform/frontend ([#3708](#3708)) ([d47967c](d47967c)) * use neutral token prefixes with legacy support ([#3719](#3719)) ([db5929c](db5929c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: archestra-ci[bot] <222894074+archestra-ci[bot]@users.noreply.github.com> Co-authored-by: Joey Orlando <joey@archestra.ai>
Summary
Fixes Bedrock Converse requests that fail when MCP tool names exceed Bedrock's provider-side tool name limit.
Root Cause
Bedrock validates
toolConfig.tools[*].toolSpec.namebefore model execution and rejects names longer than its limit. Some fully qualified MCP tool names can exceed that provider limit even though the same tool works through other providers.