Skip third-party prefix when a per-tier model override is fully-qualified#34
Open
robobryce wants to merge 1 commit into
Open
Skip third-party prefix when a per-tier model override is fully-qualified#34robobryce wants to merge 1 commit into
robobryce wants to merge 1 commit into
Conversation
…fied A `/` in an `AAB_CLAUDE_CODE_*_MODEL` value now signals it is already a fully-qualified gateway ID, so the third-party prefix is not prepended. Bare names continue to take the prefix as before. Some inference gateways use asymmetric naming across tiers — on the NVIDIA Anthropic-compatible endpoint, Opus and Sonnet share the prefix `aws/anthropic/bedrock-` while Haiku uses `aws/anthropic/claude-haiku- 4-5-v1` (no `bedrock-`, with `-v1`). Without per-tier escape, the only way to express that was to drop the prefix scheme entirely. With this change, callers can leave the prefix set for the regular tiers and pass the odd-tier-out's full ID via the per-tier override.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/in anAAB_CLAUDE_CODE_*_MODELvalue now signals it is already a fully-qualified gateway ID, so the third-party prefix is not prepended. Bare names continue to take the prefix as before.aws/anthropic/bedrock-while Haiku usesaws/anthropic/claude-haiku-4-5-v1(nobedrock-, with-v1). SettingAAB_CLAUDE_CODE_HAIKU_MODEL=aws/anthropic/claude-haiku-4-5-v1now keeps the prefix in effect for the others and skips it for Haiku.Implementation
qualify_third_party_model prefix modelinbootstrap.bash. Ifmodelcontains/it returnsmodelverbatim; otherwise it returnsprefix + model.update_bashrcandupdate_etc_environmentnow route every model name (the top-levelAAB_CLAUDE_CODE_MODELand the three per-tier overrides) through that helper when emitting the third-party branch's exports, replacing the inline${third_party_prefix}${model}concatenation.bootstrap.bashenv-var doc block updated with the new escape rule.Test plan
Run from a regular checkout (not a
.claude/worktrees/worktree per AGENTS.md guidance)../test.bash(lint + unit) — 68 of 69 pass; the one failure (install_claude_code_plugins warns and skips when claude binary is absent) reproduces verbatim on plainupstream/mainwithbats -f "warns and skips when claude binary is absent" tests/bootstrap.bats, so it is unrelated to this change. Two new unit tests cover the helper (qualify_third_party_model prepends prefix to bare model names/... returns fully-qualified ids verbatim); one newupdate_bashrctest and one newupdate_etc_environmenttest cover the integration../test.bash --docker— passed: full bootstrap inside freshubuntu:22.04,tests/e2e-assertions.bashreports all PASS lines includingANTHROPIC_DEFAULT_{HAIKU,SONNET,OPUS}_MODEL exported in both provider branches.bootstrap.bashinside a freshubuntu:22.04container withAAB_CLAUDE_CODE_INFERENCE_PROVIDER=third-party,AAB_CLAUDE_CODE_MODEL_THIRD_PARTY_PREFIX=aws/anthropic/bedrock-, andAAB_CLAUDE_CODE_HAIKU_MODEL=aws/anthropic/claude-haiku-4-5-v1. Both~/.bashrc's third-party branch and/etc/environmentended up with:./test.bash --secrets— N/A: change touches no committed credentials, only model-name string handling and tests../test.bash --e2eon a disposable VM — covered by the--dockerrun above (it invokes--e2eend-to-end inside a fresh container) and by the targeted live exercise. No additional VM run needed for this change.update_bashrc applies third-party prefix to every per-tier modelandupdate_bashrc honors per-tier AAB_CLAUDE_CODE_*_MODEL overrides(existing tests, both bare-name) still pass, confirming bare names continue to take the prefix.🤖 Generated with Claude Code