Files
backnotprop__plannotator/packages/ai
Pavan Purewal ec757d5539 fix(ai): resolve Bedrock/Vertex model ids for Ask AI (#939)
The Ask AI feature hardcodes a bare model alias ("claude-sonnet-4-6")
and force-passes it to the spawned claude binary as --model. Bare
aliases are valid against the first-party Anthropic API but are
rejected by Bedrock/Vertex, which require a full inference-profile id /
ARN, producing:

    API Error (claude-sonnet-4-6): 400 The provided model identifier
    is invalid.

Add resolveSDKModel(): when CLAUDE_CODE_USE_BEDROCK / _VERTEX is set,
map the picker's family aliases (opus/sonnet/haiku) to the matching
ANTHROPIC_DEFAULT_*_MODEL env var, pass through identifiers that are
already ARNs / inference profiles, and otherwise fall back to
ANTHROPIC_MODEL or omit --model so the SDK inherits the env default.
Off Bedrock/Vertex behavior is unchanged.

Co-authored-by: Pavan Purewal <pavandeep.purewal@ticketmaster.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 22:26:45 -07:00
..