Claude Desktop keys a profile's inferenceModels by name and reads one tier
off an entry: for each tier, the entry tagged with it (isFamilyDefault
first) names ANTHROPIC_DEFAULT_<TIER>_MODEL for the Code tab's Claude
Code (JNn/WNn in 4.16336's app.asar, FPn in 4.23118's). desktopTierOf
tags a model picked for two tiers with the first only, so the second had
no model. dawei picked copilot/claude-sonnet-5.5 for sonnet and haiku
(Copilot has no Haiku 5.5); Desktop spawned Claude Code with
ANTHROPIC_DEFAULT_HAIKU_MODEL empty, and its small tasks (WebFetch page
summaries) ran on the session's copilot/claude-opus-5.5 at 94-244 s each.
Now:
- desktopSharedTiers: each tier whose pick an earlier tier already has.
- DesktopInferenceModels lists such a model once more per later tier,
after the rows (the first row, which a new session starts on, stays
first), tagged with the tier and isFamilyDefault, with the row's 1M
fields and its label plus " · <tier>".
- desktopTierAlias names it in the form claudeLooking gives the model
under a number made of its id and the tier (magpie-<n>.anthropic.<model>,
mythos-magpie-<n>, or anthropic/magpie-<n> for a model listed by its own
id). aliased reads that number back to the model, so the gateway serves
it as the pick (desktopTierAsked), and a session saved on it is still
served after the picks change.
- desktopRunsAs (previous commit) gives it behavesAs where Claude Code
doesn't know the id.
- agent: CLAUDE_CODE_MODEL_CAPABILITIES and the modelSettings budgets
carry the extra ids too (gateway.DesktopTierAliases).
- docs/subsystems/gateway-routing.md and agent-wiring.md say so.
Not changed: /v1/models still tags one row per model (Desktop reads no
/v1/models while the list is written); the Providers page's Desktop
number is the first id's. Desktop's menu shows the extra entry
("Claude Sonnet 5.5 · Copilot · haiku"); the list has no hidden entries.
Ported from mdwsk88's desktop-tier-shared-pick (817edde09), reviewed line
by line. Added here: TestDesktopTierSharedPick's "every tier" (one model
for opus, sonnet, haiku and fable: three extra entries, every name
distinct, each tier tagged once, each id read back and its tool-less
small task served on the pick while the session is on another model)
and "own id" (a Claude model with no reasoning levels, listed by its own
id: the later tier is anthropic/magpie-<n> with behavesAs that model).
Run on mote (go1.26.8):
- TestDesktopTierSharedPick (4 subtests), TestDesktopGroupPickRunsAsItsModel,
TestClaudeDesktopModelsSharedTier, TestClaudeCapabilitiesDesktopSharedTier:
ok. Broken by hand, each red:
- desktopSharedTiers looping over no tier (the old behaviour): all four
subtests ("haiku has no entry"), and both agent tests;
- aliased not reading a tier's number back: all four subtests
("magpie-2213721611.anthropic.claude-sonnet-5-5 read back as ...").
- go test -run 'Desktop|Claude|Alias|Tier' ./internal/gateway
./internal/agent: ok. go vet darwin, linux (-tags nogui), windows,
go build ./...: ok. gofmt -l: nothing.
- Desktop's own code: the list this commit gives for opus m1, sonnet and
haiku claude-sonnet-5-5, fable m1, run through JNn/WNn taken verbatim
from Desktop 4.16336's app.asar in node: HAIKU =
magpie-2213721611.anthropic.claude-sonnet-5-5, FABLE =
mythos-magpie-7663130977, OPUS and SONNET as before. The same list
without the extra entries (the old one): HAIKU and FABLE "".
Not tried: a real Claude Desktop reading the list and starting Claude
Code; the Playwright suites (no GUI file changed). The full suite runs
after the push.
Reported-by: dawei (Discord)
Co-authored-by: mdwsk88 <11055210+mdwsk88@users.noreply.github.com>