Skip to content

Comments

fix(bedrock): update inference profile prefixes#449

Open
stevehodgkiss wants to merge 1 commit intoagentjido:mainfrom
stevehodgkiss:update-instance-profile-prefixes
Open

fix(bedrock): update inference profile prefixes#449
stevehodgkiss wants to merge 1 commit intoagentjido:mainfrom
stevehodgkiss:update-instance-profile-prefixes

Conversation

@stevehodgkiss
Copy link

@stevehodgkiss stevehodgkiss commented Feb 21, 2026

Description

I was attempting to use req_llm with caching enabled and noticed some unexpected behaviour. It was falling back to the converse API due to the inference profile I was using (au.anthropic.claude-sonnet-4-5-20250929-v1:0). This PR adds au and some other missing inference profile prefixes to the logic that strips/normalizes the model id for amazon bedrock.

Fix identified/fixed by claude code (opus 4.6):

⏺ Here's the chain that caused the fallback:

  1. get_model_family("au.anthropic.claude-sonnet-4-5-...") calls strip_region_prefix (line 926)
  2. Old strip_region_prefix didn't have "au" in its list, so it returned "au.anthropic.claude-sonnet-4-5-..." unchanged
  3. @model_families lookup (line 930) checked if the normalized ID starts with "anthropic." — but it started with "au.", so no match → found_family = nil
  4. Fallback prefix extraction (line 937) split on . → got "au" as the family
  5. Back in determine_use_converse, get_formatter_module("au") found no entry in @model_families → returned the Converse module as fallback
  6. is_fallback_to_converse (line 1152) was true → returned true at line 1177

I went with the current approach of only stripping a list of known inference profile prefixes.

Setting use_converse: false doesn't fix the issue:

To summarize the error: even with use_converse: false, the Hex version of req_llm (without the au prefix fix) still uses the Converse formatter to build the request body because get_model_family("au.anthropic...") returns "au" → no matching formatter → falls back to Converse formatter. So the endpoint is /invoke but the body is Converse-formatted — causing the "type: Field required" error.

Type of Change

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Documentation update

Testing

  • Tests pass (mix test)
  • Quality checks pass (mix quality)

Checklist

  • My code follows the project's style guidelines
  • I have updated the documentation accordingly
  • I have added tests that prove my fix/feature works
  • All new and existing tests pass
  • My commits follow conventional commit format
  • I have NOT edited CHANGELOG.md (it is auto-generated by git_ops)

Updates inference profile prefixes to correctly strip au and other
prefixes in order to get the base model name correctly.
@stevehodgkiss stevehodgkiss changed the title chore: update region prefixes to include au and others fix(bedrock): update inference profile prefixes Feb 21, 2026
@stevehodgkiss stevehodgkiss changed the title fix(bedrock): update inference profile prefixes fix(bedrock): update inference profile prefixes Feb 21, 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