Skip to content

Dedup Claude /model list#165

Open
asujithan wants to merge 1 commit into
mainfrom
asujithan/claude-list-dedup
Open

Dedup Claude /model list#165
asujithan wants to merge 1 commit into
mainfrom
asujithan/claude-list-dedup

Conversation

@asujithan

Copy link
Copy Markdown
Collaborator

Problem

ucode claude → /model showed duplicate "Opus 4.8" rows (one from ANTHROPIC_MODEL, one from ANTHROPIC_DEFAULT_OPUS_MODEL) that both resolved to the same gateway-routable id. Visually noisy and confusing — users couldn't tell which row to pick.

Fix

  • Stop setting ANTHROPIC_MODEL in render_overlay. The "Default (recommended)" row now resolves through the pinned ANTHROPIC_DEFAULT_OPUS_MODEL family alias instead of standing as its own duplicate row.
  • Actively prune stale ucode-managed model env keys in write_tool_config. deep_merge_dict doesn't remove keys absent from the overlay, so without this any ANTHROPIC_MODEL (or short-lived _NAME companions) written by older ucode versions would linger in ~/.claude/settings.json forever and the dupe would never go away. Pruning is scoped to a fixed allowlist (CLAUDE_MANAGED_MODEL_ENV_KEYS) so user-owned env vars are untouched.

Test plan

[x] uv run pytest tests/test_agent_claude.py (53 passed)
[x] uv run pytest (762 passed; 2 pre-existing env-only failures in pi/opencode user-agent e2e tests unrelated to this change)
[x] uv run ruff check .
[x] Manual: ucode claude shows 4 rows in /model; "Default (recommended)" launches in opus; /model sonnet switches families; ucode claude -- --model haiku starts in haiku

@asujithan asujithan requested a review from AarushiShah-db June 16, 2026 00:39
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