Skip to content

feat(checks): recognise Bedrock regional prefixes in model-unknown - #59

Merged
protosphinx merged 1 commit into
mainfrom
bot/model-regional-prefix
Aug 31, 2026
Merged

protosphinx merged 1 commit into
mainfrom
bot/model-regional-prefix

Conversation

@protosphinx

Copy link
Copy Markdown
Member

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. The model-unknown check compared the raw string against KNOWN_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: add REGIONAL_PREFIXES constant and stripRegionalPrefix helper; apply it inside checkModelUnknown before the KNOWN_CLAUDE_MODELS lookup
  • test/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

  • LOC delta: ~64 added, 0 removed (well under 250)
  • No src/index.ts modification
  • No runtime dependency additions
  • No .github/workflows/* changes
  • Test file present in diff

Generated by Claude Code

…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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T16:17:48.468724Z b107bf7 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/checks.ts
// 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."];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@protosphinx
protosphinx merged commit b88e03a into main Aug 31, 2026
3 checks passed
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