claude: enable Claude Code native gateway model discovery - #347
Merged
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
lilly-luo
reviewed
Aug 20, 2026
lilly-luo
left a comment
Collaborator
There was a problem hiding this comment.
can you pls gate this behind an environment feature flag (see ENABLE_MANAGED_AGENT_CONFIG) so that users won't break unless they explicitly use
Collaborator
Author
|
Addressed the opt-in request in a5eb902. Gateway model discovery is now disabled by default and only enabled when |
lilly-luo
reviewed
Aug 20, 2026
lilly-luo
reviewed
Aug 20, 2026
lilly-luo
approved these changes
Aug 20, 2026
andy-xu-db
enabled auto-merge (squash)
August 20, 2026 19:24
Collaborator
Author
|
/merge |
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
Adds opt-in support for Claude Code's native gateway model discovery. Set
ENABLE_CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY=1before launching ucode to have Claude Code's/modelpicker list every gateway Messages-API endpoint, rather than only 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). Keeping this behind an opt-in ucode environment flag prevents behavior changes for existing users while allowing custom Model Serving endpoints whose ids carryclaude/anthropic(for example,main.default.my_anthropic_msorsystem.ai.claude-opus-4-8) to appear and route natively as 3-part FQNs.What changed
render_overlaysetsCLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1only whenENABLE_CLAUDE_CODE_GATEWAY_MODEL_DISCOVERYis enabled (1,true, oryes).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 cannot resolve it.gateway_proxy.py) forwards/v1/modelsto the gateway.Testing
test_agent_claude.pysuite passes (110 tests).This pull request and its description were written by Isaac.