Skip to content

Fix stale Claude model discovery setting - #445

Merged
lilly-luo merged 5 commits into
mainfrom
lilly-luo_data/stack/fix-claude-model-discovery-state
Sep 2, 2026
Merged

Fix stale Claude model discovery setting#445
lilly-luo merged 5 commits into
mainfrom
lilly-luo_data/stack/fix-claude-model-discovery-state

Conversation

@lilly-luo

@lilly-luo lilly-luo commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

problem: if i ran --enable-model-discovery or --enable-smart-routing at any point, then CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY env var gets set to 1.

However, it does not get pruned later if i run ucode claude without --enable-model-discovery. as such, once you enable model discovery, it's basically enabled forever.

this PR
1/ prunes CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY if --enable-model-discovery or --enable-smart-routing is not set
2/ avoids setting the env var in settings.json if the flags are passed

test:

  • confirm ucode claude --enable-model-discovery still works
  • confirm ucode claude --enable-model-discovery still works but when i close, the settings.json does not leave behind CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1
  • confirm ucode claude --enable-smart-routing still works
  • confirm ucode claude --enable-smart-routing still works but when i close, the settings.json does not leave behind CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1

@lilly-luo
lilly-luo force-pushed the lilly-luo_data/stack/fix-claude-model-discovery-state branch from 30400ea to ce72b71 Compare September 2, 2026 02:23
@lilly-luo
lilly-luo force-pushed the lilly-luo_data/stack/fix-claude-model-discovery-state branch from ce72b71 to 3f2c822 Compare September 2, 2026 02:27
@lilly-luo
lilly-luo marked this pull request as ready for review September 2, 2026 02:30
@lilly-luo
lilly-luo requested a review from andy-xu-db September 2, 2026 13:08
Comment thread src/ucode/agents/claude.py
@lilly-luo
lilly-luo enabled auto-merge (squash) September 2, 2026 14:57
@lilly-luo
lilly-luo disabled auto-merge September 2, 2026 14:57
@lilly-luo
lilly-luo merged commit c9335c8 into main Sep 2, 2026
2 checks passed
@lilly-luo
lilly-luo deleted the lilly-luo_data/stack/fix-claude-model-discovery-state branch September 2, 2026 14:57
andy-xu-db added a commit that referenced this pull request Sep 2, 2026
Reconcile PR #445 (launch-scoped, never-persisted
CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY) with this branch's removal
of the Anthropic model-discovery proxy:

- launch(): first_prompt_routing goes straight to
  smart_routing_v2.launch_claude (no proxy); the discovery branch sets
  CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY in the process env and falls
  through to the direct gateway launch instead of the proxy.
- tests: keep test_gateway_discovery_uses_direct_gateway and add the
  launch-scoped discovery-flag assertion; drop the two proxy-based tests.

Co-authored-by: Isaac <no-reply@databricks.com>
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.

2 participants