Support Bedrock application inference profile ARNs as model ids#1
Merged
mattwebbio merged 1 commit intoJun 29, 2026
Conversation
Application inference profiles (used for cost-allocation tagging) are invoked by
passing their ARN as the modelId. The Bedrock provider built the request path as
"/model/#{@model.id}/converse" with the id raw, so an ARN's internal "/"
(".../application-inference-profile/<id>") was parsed as a path separator in both
the request URL and the SigV4 canonical path — AWS then rejected it with
"The provided model identifier is invalid".
Percent-encode the model id's "/" so the ARN stays a single path segment.
canonical_uri re-encodes per segment, which double-encodes it as SigV4 requires for
non-S3 services, keeping the signed and sent paths consistent. No-op for ordinary
model ids (which contain no "/"); ":" version suffixes are valid path-segment
characters and are unaffected.
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.
Brings the Bedrock application-inference-profile ARN fix into the AppFolio company fork.
The fix percent-encodes a model id's
/(%2F) so an application-inference-profile ARN stays a single path segment in the Converse/model/<id>/converseandconverse-streamURLs (and the SigV4 canonical path), instead of being truncated and rejected by Bedrock with "The provided model identifier is invalid". No-op for ordinary model ids.This is the same change as the open upstream PR crmne#803, which remains open off
mattwebbio:bedrock-application-inference-profile-arn. This appfolio-forkmainbecomes the source of truth thatagents_appconsumes (via Dependabot tracking this fork) until the fix is released upstream.Single commit: 528c2df.
🤖 Generated with Claude Code