claude: enable Claude Code native gateway model discovery - #347
Open
andy-xu-db wants to merge 1 commit into
Open
claude: enable Claude Code native gateway model discovery#347andy-xu-db wants to merge 1 commit into
andy-xu-db wants to merge 1 commit into
Conversation
Set CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1 in render_overlay so the /model picker lists every gateway Messages-API endpoint, not just the ANTHROPIC_DEFAULT_* family aliases. Skipped under a Model Provider Service: its routing header would send a discovered gateway id to a provider that can't resolve it. Co-authored-by: Isaac
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
Sets
CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1inrender_overlayso Claude Code's/modelpicker lists every gateway Messages-API endpoint — not just theANTHROPIC_DEFAULT_*family aliases ucode injects today.Why
Claude Code has native gateway model discovery: when enabled, it fetches
GET {ANTHROPIC_BASE_URL}/v1/modelsand adds a picker row for each returned id (filtered to ids containingclaudeoranthropic). ucode already setsCLAUDE_CODE_USE_GATEWAY=1but never turned on discovery, so the picker only shows the family-alias rows. This flag makes custom Model Serving endpoints whose ids carryclaude/anthropic(e.g.main.default.my_anthropic_ms,system.ai.claude-opus-4-8) appear and route natively as 3-part FQNs.What changed
render_overlaysets the flag, gatednot provider: a Model Provider Service routes every request to the external provider via header, so a discovered gateway endpoint id would reach a provider that can't resolve it — discovery is off in that mode.gateway_proxy.py) forwards/v1/modelsto the gateway.Testing
test_agent_claude.py: flag is set on a normal launch; skipped underprovider.test_agent_claude.pysuite passes (102 tests).This pull request and its description were written by Isaac.