Skip to content

Fix stale Claude model discovery setting - #445

Open
lilly-luo wants to merge 2 commits into
mainfrom
lilly-luo_data/stack/fix-claude-model-discovery-state
Open

Fix stale Claude model discovery setting#445
lilly-luo wants to merge 2 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
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