Skip to content

feat(settings): use model aliases + 1M context toggle + custom ID#213

Merged
tylergraydev merged 1 commit into
tylergraydev:mainfrom
prefrontalsys:feat/model-aliases-1m-context
May 4, 2026
Merged

feat(settings): use model aliases + 1M context toggle + custom ID#213
tylergraydev merged 1 commit into
tylergraydev:mainfrom
prefrontalsys:feat/model-aliases-1m-context

Conversation

@prefrontalsys

Copy link
Copy Markdown
Contributor

Closes #212.

Summary

The Default Model dropdown in Settings → Models shipped hardcoded full model IDs (claude-sonnet-4-5-20250929, claude-opus-4-6, claude-haiku-4-5-20251001) that go stale every time Anthropic ships a new model. This PR switches to model aliases — Claude Code's documented mechanism for forward-compatibility — and adds the missing 1M context window toggle plus a custom model ID escape hatch.

Why aliases

Per the Claude Code model-config docs:

Aliases point to the recommended version for your provider and update over time.

Aliases (opus, sonnet, haiku, opusplan, best) auto-resolve on the provider side, so the tool-manager no longer needs a release every time a new model lands. There's no authoritative client-side way to list available models without an ANTHROPIC_API_KEY (subscription users may not have one), so aliases are the most robust choice.

Changes

src/lib/types/claudeSettings.ts

  • CLAUDE_MODELS now lists aliases (opus, sonnet, haiku, opusplan, best) with a supports1m: boolean flag.

src/lib/components/claude-settings/ModelConfigEditor.svelte

  • Adds an "Other (custom model ID)…" option that reveals a free-text input. Accepts any string — full model name, Bedrock ARN, Vertex version name, Foundry deployment name.
  • Adds a "Use 1M token context window" checkbox that appends the documented [1m] suffix to the saved model ID. Auto-disables when a non-1M model (Haiku) is selected. Round-trips correctly through settings.model.
  • Inline help text links to the official Claude Code docs.

src/tests/components/claude-settings.test.ts

  • Updates the previously-mislabeled "Extended Context Types" describe block to verify the alias contract and the supports1m flag per model.

Test plan

  • npm test -- --run — all 1565 tests pass
  • npm test -- --run src/tests/components/claude-settings.test.ts src/tests/components/model-overrides.test.ts — 24/24 pass
  • npm run check — no new errors introduced (75 pre-existing errors in unrelated files like ContainerTerminal.svelte, keybindingsLibrary.test.ts, none touched by this PR)
  • Manual: set Default Model to opus, check 1M box → saved as opus[1m]
  • Manual: switch to Haiku → 1M checkbox auto-disables and clears
  • Manual: select "Other (custom)" → enter arn:aws:bedrock:… → saves verbatim
  • Manual: load existing settings.model: "claude-opus-4-7[1m]" → custom field shows claude-opus-4-7, 1M box checked

Notes

  • AVAILABLE_MODEL_SHORTCUTS (the "Available Models" multi-select) is unchanged — it already used aliases.
  • SubAgentForm.svelte model picker is unchanged — it already used aliases.
  • model-overrides.test.ts is unchanged — its fixtures use full IDs as map keys to test the override mechanism, which is still correct semantically.

The Default Model dropdown shipped hardcoded full IDs (claude-sonnet-4-5-*,
claude-opus-4-6, claude-haiku-4-5-*) that go stale every Anthropic release.
Switch to documented model aliases (opus, sonnet, haiku, opusplan, best)
which auto-resolve to the latest version on the provider side, plus add
the missing 1M-context toggle and a custom-ID escape hatch.

Changes:
- CLAUDE_MODELS now lists aliases with a supports1m flag per entry
- ModelConfigEditor: add "Other (custom)" option with free-text input
- ModelConfigEditor: add "Use 1M token context window" checkbox that
  appends/strips the documented [1m] suffix; auto-disables for Haiku
- Tests updated to verify the alias contract and 1M-capability flags
- Inline doc links to code.claude.com/docs/en/model-config

Refs: tylergraydev#212
@tylergraydev tylergraydev merged commit f53bdda into tylergraydev:main May 4, 2026
10 checks passed
tylergraydev pushed a commit that referenced this pull request May 4, 2026
User-facing additions:
- Model picker now uses Claude Code aliases (opus/sonnet/haiku/opusplan/best)
  with a 1M context toggle and a free-form "Other (custom model ID)" field
  for Bedrock ARNs / Vertex / Foundry IDs (#213).
- Rules dropped into ~/.claude/rules/ or {project}/.claude/rules/ now show
  up in the UI via new global/project scanners (#200).

Fixes:
- Sync Config no longer wipes externally-managed configs (.mcp.json,
  claude.json, OpenCode/Copilot/Cursor/Gemini/Codex) — extends the #191
  guard to all 7 writers and imports .mcp.json on project add (#204).
- Skill/command/sub-agent writers emit `tags` as JSON arrays so they
  round-trip through the DB reader (#202).
- PR builds from forks/Dependabot no longer fail on missing
  TAURI_SIGNING_PRIVATE_KEY (#203).
- delete_rule_inner returns real DB errors instead of swallowing them as
  "row absent" (follow-up to #200).

Internal:
- Cargo clippy from 134 warnings to 0; CI now enforces -D warnings on
  --lib --tests (#205).

All 1565 frontend tests and 2021 Rust tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.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.

Settings: Default Model dropdown ships stale hardcoded model IDs and lacks 1M context toggle

2 participants