← Back to PRs

#8963: fix(bedrock): fix amazon bedrock model problem of dealing with profile

by 67ailab open 2026-02-04 17:22 View on GitHub →
agents stale
### Problem AWS Bedrock requires inference profile IDs (with regional prefixes like us., eu., global.) for newer models like Claude Opus 4.5. OpenClaw's model lookup failed because: 1. Auto-discovery returns base IDs (e.g., anthropic.claude-opus-4-5-20251101-v1:0) 2. Users need to use prefixed IDs (e.g., us.anthropic.claude-opus-4-5-20251101-v1:0) 3. Exact match lookup failed since the IDs don't match ### Solution (in src/agents/pi-embedded-runner/model.ts): - Added stripBedrockInferenceProfilePrefix() to parse regional prefixes - Added findInlineModel() helper for flexible Bedrock model matching - Updated resolveModel() to match prefixed IDs against base model definitions - The prefixed ID is preserved and sent to AWS for correct inference profile usage ### Usage: Configure with the prefixed model ID: ``` { "agents": { "defaults": { "model": { "primary": "amazon-bedrock/us.anthropic.claude-opus-4-5-20251101-v1:0" } } } } ``` <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This change teaches `resolveModel` to handle Amazon Bedrock “inference profile” model IDs that include regional prefixes (`us.`, `eu.`, `ap.`, `global.`). It does this by stripping the prefix for lookup (registry + inline provider config), while preserving the original prefixed ID on the returned `Model` so the Bedrock API call still uses the required inference-profile identifier. Tests were expanded to cover prefixed/unprefixed Bedrock IDs and to unit-test the prefix stripping helper. <h3>Confidence Score: 4/5</h3> - This PR is close to safe to merge once the obvious dead-code/unused-local is removed. - Core lookup logic for Bedrock-prefixed IDs is straightforward and covered by tests, but `model.ts` currently contains a computed-and-unused variable block that is likely to trigger lint/TS unused-local checks and should be fixed before merging. - src/agents/pi-embedded-runner/model.ts <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs