Skip to content

Support Bedrock application inference profile ARNs as model ids#1

Merged
mattwebbio merged 1 commit into
appfolio:mainfrom
mattwebbio:bedrock-application-inference-profile-arn
Jun 29, 2026
Merged

Support Bedrock application inference profile ARNs as model ids#1
mattwebbio merged 1 commit into
appfolio:mainfrom
mattwebbio:bedrock-application-inference-profile-arn

Conversation

@mattwebbio

Copy link
Copy Markdown

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>/converse and converse-stream URLs (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-fork main becomes the source of truth that agents_app consumes (via Dependabot tracking this fork) until the fix is released upstream.

Single commit: 528c2df.

🤖 Generated with Claude Code

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.
@mattwebbio mattwebbio merged commit e856428 into appfolio:main Jun 29, 2026
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