Commit Graph
3 Commits
Author SHA1 Message Date
yetone a1f56720cd gateway: Claude Desktop's catalog-named rows say their provider in the description (4 v5)
4 v5 on Discord: with Provider in model names on, Claude Desktop's picker
listed four relays' Opus 5.5 (老林夕, 新林夕, 百德, chatflowsai) all as
"Opus 5.5 (…7922287072.anthropic.claude-opus-5-5)", told apart only by
the id's tail.

Cause: a Claude model with reasoning levels is listed as
magpie-<n>.anthropic.<model> so Desktop gives it the effort picker
(claudeLooking). Desktop 4.4212 labels a picker row by labelOverride,
then its signed catalog's name, then display_name (ngn in
index.chunk-m4oMImJ-.js), so our display_name "Opus 5.5 · 老林夕" is
never shown for those ids; Qhn then appends the differing id tail to rows
of one name. labelOverride comes only from an admin inferenceModels list
in Desktop's profile (static, read at start, sealed at rest in 4.4212,
and it can't say DesktopLongest's "[1m] only"), so magpie doesn't write
it. Turning the catalog off would lose the effort picker for opus/sonnet
5.5 (Kfn lacks them).

Change: Desktop shows the gateway's description under the name, before
the catalog's (which has none for these models). desktopModels now puts
the provider there for a catalog-named row (DesktopNumber != "") when the
Provider in model names setting puts it after the name (desktopSaidBy):
on, every one; own, every vendor-named one; off, only two of one name. A
DesktopLongest 1M row says "1M context window · <provider>". Ids are
unchanged, so saved sessions and picks still resolve. Rows Desktop names
by display_name are unchanged. agent-wiring.md updated.

Run on mote. At base d24be3c25 with this change: go test -count=1
-timeout 45m ./internal/gateway ./internal/gui ./internal/agent: agent
ok; gateway red on TestCompactionOverByteCapEveryTime (new, filed #4862)
and TestCodexPoolSaysTheClientsVersion (#4807), both ok alone at
origin/main 4fc34828e and at this head; gui red on
TestMainWindowCorners/macOS_26_SDK (#3949), red the same alone at
origin/main 4fc34828e. At the pushed head (rebased on 4fc34828e): gofmt
-l clean; go vet ./internal/gateway ./internal/gui darwin and windows ok,
GOOS=linux ./internal/gateway ok (./internal/gui doesn't cross-vet for
linux: wails needs cgo, the same at origin/main); -run
'Desktop|Science|KeyModels|Decider|CallerKey' over ./internal/gateway
./internal/gui ok, plus the two gateway reds above ok.

Broken by hand: desktopSaidBy always "" made
TestClaudeDesktopCatalogNamedSaysProvider red (14 rows undescribed and
the 1M row "1M context window" alone); dropping the label check made it
red under Off (the lone Sonnet 5.5 said "chatflowsai").

Not tried: the real Claude Desktop picker. Desktop 4.4212 on mote in a
sandbox HOME refused --remote-debugging-port, stalled at start before
asking /v1/models (likely a Keychain prompt), and screencapture fails
over ssh, so the row text under the name is read from its bundle, not
seen. Desktop's own added 1M variant of a row can't take a description
from the gateway (it always gets "1M context window"); it keeps the id
tail Desktop gives it.

Reported by 4 v5 on Discord.
2026-11-02 14:04:56 +08:00
yetone bb3b3f1486 gateway: with "only each model's largest window" on, Claude Desktop shows a model of 1M or more as its 1M entry, "1M context window", not as what looked like the plain model (杰多夫 on Discord)
The cause: under settings.DesktopLongest, /v1/models lists such a model by
its "[1m]" id alone (#1272). Claude Desktop 2.7032 (app.asar, read only)
marks an entry as the 1M one only on the entry it adds itself: JLt emits
`${id}[1m]` with description WLt = "1M context window" and
supports_1m_context, and only for a model with supports1m. PIt gives
supports1m to a bare id alone (LC(id) === id), and OIt folds a "[1m]" row
only into a bare one listed beside it. So the lone "[1m]" row was shown by
its name with no description, exactly like the plain entry it replaced: with
the switch off the menu had "DeepSeek V4 Pro" plus "DeepSeek V4 Pro · 1M
context window"; on, only "DeepSeek V4 Pro". The reporter read that as the
switch keeping the plain model and dropping the 1M one.

What changed: such a row now carries description "1M context window", the
words Desktop gives its own 1M entry, and Desktop shows a row's description
(PIt keeps it; JLt prefers it to its fallback). The id is unchanged: the
"[1m]" is what gives a Claude Code session the 1M window, and magpie serves
it as the plain model. Rows under 1M, and every row with the switch off, are
unchanged (no description).

What was run:
- TestClaudeDesktopLongestOnly now checks each row's description, on and
  off. With the description line removed it fails: "on: vend/deepseek-v4-pro
  (...[1m]) described "", want "1M context window"".
- Sandbox HOME gateway on 127.0.0.1:3561 with real providers, /v1/models
  as Claude Desktop asks for it, fed through a script that follows
  PIt/OIt/JLt: on, each 1M model is one entry "<name> · 1M context window";
  off, the plain entry plus Desktop's own 1M one, as before.
- gofmt -l; GOOS=linux and GOOS=windows go vet -tags nogui
  ./internal/gateway; go test -tags nogui ./internal/gateway under a temp
  HOME: ok. No GUI or string change.
2026-10-10 09:58:30 +08:00
yetone a2a7fb1123 gateway, gui: Claude Desktop can list a model of 1M or more once, as its 1M entry (#1272)
Claude Desktop reads magpie's gateway models and, for every row whose
max_input_tokens is 1,000,000 or more and whose id has no [1m] suffix,
adds a second "1M context window" entry; an id that already ends in [1m]
gets one entry (BIt/PIt/JLt in Desktop's index chunk). So every 1M model
showed twice. A new switch under Agents → Claude Desktop, "Only each
model's largest window" (settings desktopLongest, off by default), lists
such a model by its [1m] id. Models under 1M keep their real window;
fast/non-fast, providers and groups stay separate rows. The base id still
resolves (aliased, Resolve and SwitchedOff trim [1m]), so sessions saved
on it keep working. Desktop needs a restart to re-read the list.

Verified:
- TestClaudeDesktopLongestOnly fails without the change ("on: 6 entries
  of 4 rows") and passes with it; the [1m] and old plain ids reach
  upstream as the same model.
- Desktop's own discovery and menu code, extracted from a copy of
  app.asar, run over magpie's output: off 4 rows → 6 entries, on 4 rows
  → 4 entries.
- desktop-longest.test.cjs (Chromium and WebKit, en/zh, 1100/640px)
  times out on origin/main's app.js and passes 8/8; gui-ja, gui-de,
  gui-zh-tw, i18n-keys, desktop-model-menu, desktop-tiers,
  agent-models-redraw and click-scroll pass 44/44.
- go test (sandbox HOME, nogui) gateway, gui, settings, agent pass;
  go vet for darwin, linux and windows.
- Full GUI suite: 3802/3809. agent-expand-steady, panel-arrange,
  redact-rule-row, remote-magpie and signin-again pass alone;
  context-window fails alone with origin/main's assets too.
Not verified: the real Desktop menu after a restart (its live config was
not touched).
2026-10-08 18:11:30 +08:00