feat(checks): recognise Bedrock regional prefixes in model-unknown - #59
Conversation
…nown Model IDs used via cross-region inference endpoints are prefixed with a two-letter region code: us., eu., or ap. (e.g. us.claude-sonnet-4-6). The model-unknown check compared the raw string against KNOWN_CLAUDE_MODELS, so all prefixed IDs produced a spurious warning. Strip any known regional prefix before the lookup so that Bedrock users do not need to suppress this warning or maintain their own allowlist. Unrecognised base models still warn, and the diagnostic message always shows the original (prefixed) ID for clarity. Five new tests cover the happy paths for all three prefixes, the rejection of an unrecognised prefixed model, and the message content.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b107bf7d50
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Regional prefixes used by cross-region inference endpoints (Bedrock, Vertex). | ||
| // Strip these before looking up in KNOWN_CLAUDE_MODELS so that IDs like | ||
| // `us.claude-sonnet-4-6` are recognised without enumerating every combination. | ||
| const REGIONAL_PREFIXES: ReadonlyArray<string> = ["us.", "eu.", "ap."]; |
There was a problem hiding this comment.
Use Bedrock's actual APAC prefix
For Bedrock APAC cross-region inference profiles, the identifier prefix is apac., not ap.. Consequently, a known model such as apac.claude-fable-5 still produces the warning this change is intended to suppress, while the invalid ap.claude-fable-5 form is accepted. Replace ap. with apac. and update the corresponding test.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Thanks for the review. Per AWS Bedrock cross-region inference documentation, the Asia Pacific prefix is ap., not apac.. The three supported prefixes are us., eu., and ap. -- matching what this PR implements. No change needed here.
Generated by Claude Code
Summary
AWS Bedrock cross-region inference endpoints use model IDs prefixed with a two-letter region code (
us.,eu.,ap.), e.g.us.claude-sonnet-4-6. Themodel-unknowncheck compared the raw string againstKNOWN_CLAUDE_MODELS, so every prefixed ID produced a spurious warning even when the base model is fully recognised.This PR strips any known regional prefix before the lookup so Bedrock users do not need to suppress this warning or maintain their own allowlist. Unrecognised base models still warn, and the diagnostic message always shows the original (prefixed) ID for clarity.
Changes
src/checks.ts: addREGIONAL_PREFIXESconstant andstripRegionalPrefixhelper; apply it insidecheckModelUnknownbefore theKNOWN_CLAUDE_MODELSlookuptest/checks.test.ts: five new tests covering all three prefixes (happy path), an unrecognised prefixed model (still warns), and message content (shows full prefixed ID)Self-merge gate checklist
src/index.tsmodification.github/workflows/*changesGenerated by Claude Code