fix: Amazon Bedrock Converse requests fail for ARN model IDs containing slashes - #17525
Conversation
Bugfix reviewOutcome: approved Reproduction replayStatus: no-longer-reproduces The exact original reproduction completed successfully and the original bug signal did not appear. Fixes issueStatus: fully-addresses The URL builder now fully percent-encodes model IDs, keeping ARN slashes within the modelId path segment for both Converse generation and streaming. The generic implementation covers application inference profiles, foundation-model ARNs, and other slash-containing ARN forms. Side effectsRisk: low The change restores the encoding behavior used before the regression and leaves ordinary model IDs functionally unchanged. It affects only construction of Bedrock chat-model request URLs. PerformanceRisk: none The change removes conditional checks and two replacement passes, adding no persistent allocations, buffering, or additional network work. Backwards compatibilityRisk: none This request-time URL construction change does not read, migrate, or modify stored data and restores previously working ARN behavior. SecurityRisk: none No authentication or credential handling changes were introduced; encoding reserved path characters reduces path-segment ambiguity rather than expanding it. TestingStatus: appropriate Route-sensitive regression tests cover successful Converse generation and ConverseStream output with a slash-containing ARN, while the authoritative replay exercises the original live workflow. The complete package test suites passed in both Node and edge environments. VerificationReviewed the three-file diff and relevant history, confirmed application-profile and foundation-model ARN slashes are encoded, and found the diff check clean. The Amazon Bedrock package build and type-check passed, as did all 414 Node tests and all 414 edge tests. Relevant Documentation |
|
🚀 Published in:
|
…ontaining slashes (#17550) ## Background Amazon Bedrock Converse generation failed and streaming returned empty text when ARN model IDs contained `/`. ## Root Cause The chat model URL builder decoded `%2F` in ARN model IDs, splitting the model ID across URL path segments and causing Bedrock to return an UnknownOperationException; route-sensitive regression tests confirmed the malformed path. ## Summary Restored full percent-encoding of model IDs when constructing Amazon Bedrock Converse and ConverseStream URLs. ## Testing Updated the existing chat language model tests with route-sensitive generate and stream coverage using inline snapshots, and added a patch changeset. ## End-to-end Validation - `pnpm -C packages/amazon-bedrock build && pnpm -C examples/ai-functions exec tsx src/reproduction/issue-17523-bedrock-arn-model-id.ts` — live Bedrock generation and streaming succeeded with the inference-profile ARN, returning assistant text and finish reason `length`. ## Related Issues Fixes #17523 Closes #17524 Backport of #17525 Co-authored-by: PaulBanusIAD <120463976+PaulBanusIAD@users.noreply.github.com>
Background
Amazon Bedrock Converse generation failed and streaming returned empty text when ARN model IDs contained
/.Root Cause
The chat model URL builder decoded
%2Fin ARN model IDs, splitting the model ID across URL path segments and causing Bedrock to return an UnknownOperationException; route-sensitive regression tests confirmed the malformed path.Summary
Restored full percent-encoding of model IDs when constructing Amazon Bedrock Converse and ConverseStream URLs.
Testing
Updated the existing chat language model tests with route-sensitive generate and stream coverage using inline snapshots, and added a patch changeset.
End-to-end Validation
pnpm -C packages/amazon-bedrock build && pnpm -C examples/ai-functions exec tsx src/reproduction/issue-17523-bedrock-arn-model-id.ts— live Bedrock generation and streaming succeeded with the inference-profile ARN, returning assistant text and finish reasonlength.Related Issues
Fixes #17523
Closes #17524
Co-authored-by: PaulBanusIAD 120463976+PaulBanusIAD@users.noreply.github.com