Commit Graph
1 Commits
Author SHA1 Message Date
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