Commit Graph
6 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 81a24cf8fe groups: a found group is listed as auto/<model id as the vendor spells it>
ZeroClover asked on X: Auto Group ids group/auto-<slug> can't be looked
up on models.dev. A found group is now listed and written as
auto/<model>, e.g. auto/claude-opus-5.5: /v1/models, the catalog, agent
configs, the GUI's Routing page and the CLI. Context and output limits
come from the model's metadata as before.

What stays the same:
- The internal id is still group/auto-<slug> (Group.Ref() gives the
  public one). Every old form is still accepted as input forever:
  provider.CanonicalRef turns auto/<model>[:level][[1m]] into it at the
  gateway (validateModel), keys, stats, affinity and usage, so both ids
  route to the same group and count as one.
- A key's model list allows a model by either id, group/* included
  (allows() in key_models.go).
- Hand-made groups stay group/<id>.
- A provider whose stored id is "auto" keeps its models: while one
  exists, found groups are listed by their old id (AutoRefsOn) and
  auto/<x> means that provider's model. Documented in
  docs/subsystems/gateway-routing.md.

Agent configs: SyncCatalog rewrites a field that holds a found group's
old id (renameFoundGroups), but only while the value is still what
applied.json says magpie wrote; a value the user set stays. A pick by
the old id written now is written as auto/<model> (Apply). Hidden,
picked and ordered model lists saved by the old id hold for the new one
(visible.go), and a bare model id still reaches its found group (bare.go).

Claude Code is given a dotted Claude version dashed (ClaudeSpelled), so
auto/claude-sonnet-4.5 sits in its settings as auto/claude-sonnet-4-5.
That routes to the same group, but with found groups off nothing reads
it back dotted, and Reseat took the field for changed and left the agent
on a group that was gone. Reseat now compares a group pick by its
canonical id (samePick). The old ids had no dots, so this is new with
auto/<model>.

Run at this tree (sandbox HOME, caches pinned):
- gofmt -l: clean. go vet ./...: clean on darwin, GOOS=linux -tags
  nogui, GOOS=windows.
- go test -p 4 -timeout 45m ./...: every package ok except agent and
  gateway, whose failures were the tests' expected ids (updated here)
  and two regressions now fixed (bare ids; desktop models hiding groups
  by prefix). Every failing test passes on rerun. Load average was
  ~210-290 from other sessions throughout.
- Reruns: provider, cli, codexcat ok. internal/gui: only
  TestSetAnswersWhileDevinAndProvidersHang fails (set slow/slow-1 took
  10.19s), and it fails the same in a git-archive export of 33dbdcc52.
- agent and gateway in full, -p 2 -timeout 120m: gateway ok (2996s).
  agent failed four tests that still expected the old ids
  (TestOmp/PiModelsAskedOnTheirNativeAPI, TestReseatFoundGroupsOff,
  TestReseatKeepsAFoundGroupWithAProviderOff); updating them showed the
  Reseat bug above. After the fix, go test -count=1 -timeout 120m
  ./internal/agent/: ok (1000s, load ~160-220).
- GUI files the change reaches, chromium and webkit: group-found-off and
  the routing files pass, except routing-bodies, routing-model-rest,
  routing-keys-fold and routing-request-metrics, which fail the same with
  33dbdcc52's JS.

Broken by hand and watched red, then restored: CanonicalRef in
validateModel (both-ids routing test), allows() (key tests both ways),
the Save refusal and AutoRefsOn checks in Ref/CanonicalRef (provider
named auto), catalog.Lists' preference (models.dev lookup of the part
after auto/), renameFoundGroups' applied.json check and its SyncCatalog
call (user values kept), PublicRef in visible.go, the codexcat prefix,
samePick in Reseat (TestReseatFoundGroupsOff: opus left on the gone
group).
TestBareModelIDsShared was red before the bare.go fix.

Not verified: no real agent, vendor or models.dev client run; no run on
the Windows box. Settings pickers (vision, title model) holding a saved
group/auto-... value may show it as saved. codexcat can't tell a stored
"auto" provider apart, so its models lose the "text only" hint. The
pre-existing reds above are not filed.
2026-10-20 00:18:51 +08:00
yetone 39bebbbdf3 gateway: Claude Desktop's Code tab and a build with no version keep the mythos alias (#2426)
67293346e gave Desktop the plain anthropic/magpie-<n> alias whenever its
User-Agent had no " Claude/<ver>". The Code tab's Claude Code calls with
"claude-cli/2.1.x (external, claude-desktop)" and current builds, so its
reasoning-level models lost their effort picker. desktopKnowsMythos is
now false only for a build whose version it reads and that is older
than 2; no version reads as a current build.

Run:
- On 67293346e's desktop.go the Code-tab UA listed
  anthropic/magpie-5487751739; with this it lists mythos-magpie-<n>.
- desktop_models_test: the old build gets the plain alias; the 2.7032
  UA, the claude-cli UA and "" get mythos-magpie-<n>.
- go test -count=1 -timeout 45m ./internal/gateway ./internal/provider ok.
- gofmt clean; go vet -tags nogui darwin, linux, windows ok on gateway.
Full suite: gateway and provider only here; the release head runs ./... before its tag.
2026-10-16 00:46:27 +08:00
ggbdpq a69b9b524a gateway: list Claude Desktop a reasoning-level model by its plain alias when its build has no mythos word
What changed
- Claude Desktop builds older than the mythos word (the Store's 1.6608.2,
  #2426) keep a gateway model only when its id reads as a sonnet|opus|haiku
  tier or has claude, sonnet, opus, haiku or anthropic in it, so every
  reasoning-level model listed by mythos-magpie-<n> vanished from their
  model menu. desktopModels now takes what the request's User-Agent says of
  the build (desktopKnowsMythos: " Claude/2.x" and up takes mythos,
  anything older or unreadable does not) and lists such a model by its
  plain anthropic/magpie-<n> alias, which every build keeps, instead.
  Those builds have no mythos effort table either, so no picker is lost
  there. A build that says 2.x keeps the picker alias, and Desktop's
  Code-tab ids (Claude Code's) are unchanged.
- TestClaudeDesktopEffortIDs asks as 2.7032.0 now; the old build is
  covered by TestClaudeDesktopOldBuildModels and TestDesktopKnowsMythos.

Run
- before: TestClaudeDesktopOldBuildModels red at 422d057d —
  "opencode-go/deepseek-v4.1-flash is listed as mythos-magpie-5487751739,
  which the build drops" (the reporter's own id); after: green
- go test -tags nogui -p 2 -count=1 ./internal/gateway/ (full package, ok)
- gofmt -l internal/ clean; go vet and GOOS=linux vet -tags nogui and
  GOOS=windows vet clean; go build and GOOS=linux build -tags nogui and
  GOOS=windows build ok (darwin vet/build: known trayimage cgo warning
  and ld duplicate-library warnings)

Generated-by: GLM-5.3-Flash (ZCode)
2026-10-16 00:46:26 +08:00
NineSu df29a511e6 gateway: Claude Desktop's model menu names a model as the agents' lists do, by the Provider in model names setting (#1746, marsxxl)
/v1/models for claude-desktop named every model by its own name alone,
with its provider's id in parentheses only where two read the same
(desktopNames, 03421f9f), so with the setting on Codex's list said
"Grok 4.7 @ 500k · Cursor" while Desktop's menu said "Grok 4.7 @ 500k",
and only same-name models got "(cursor)" (Gemini 3.8 Flash (cursor),
(antigravity)). The menu now names models as every agent's list does
(provider.Labels): on, the name with its provider's display name after
it; own, a name the user gave as they wrote it and a vendor's with its
provider's; off, plain names — and two of one name keep their provider's
so they stay apart, while where that still leaves two alike (one
provider's models named alike) the whole catalog id follows, for
Desktop's menu shows the name alone. 蓝猫's plain names (03421f9f) are
the setting's off; a user-given name that already says its provider is
left without it, as Label does everywhere.

Nothing changes for ids, routing, tiers, the 1M listing or the effort
picker. A model whose id reads as one of Desktop's own Claude models is
still renamed by Desktop's own catalog there ("Opus 5.5"), which no
gateway can reach; every other model's display_name is rendered, as the
reporter's "(cursor)" names show.

What was run: go test ./internal/gateway/ -count=1 (ok, 209s) with the
rewritten TestClaudeDesktopPickedModels and TestDesktopNames and the new
TestClaudeDesktopNamesFollowSuffixMode (on/own/off through /v1/models
with the claude-desktop key, red before the change); go test
./internal/provider/ ./internal/agent/ ./internal/codexcat/ -count=1
(ok); HOME=<temp> go test -tags nogui -count=1 ./... (ok, no FAIL);
gofmt -l clean; go vet on darwin, GOOS=linux and GOOS=windows. The
desktop GUI .cjs tests were not run (no playwright in this checkout):
they fake the backend and no GUI file changed. Not tried against a real
Claude Desktop: that it renders these display_name values is from the
reporter's screenshot, whose "(cursor)" names were this same field.
2026-10-13 05:48:39 +08:00
yetone 03421f9f42 agent: Claude Desktop's row picks which magpie models Desktop's own model menu lists, several at once, and the menu names them by the model's own name (蓝猫 on Discord: wanted to pick a few models and switch among them in Desktop, and Desktop showed "DeepSeek V4.1 Flash (opencode-go)" where they want "DeepSeek V4.1 Flash") — Desktop already read its menu from the gateway's /v1/models for claude-desktop (desktopModels over provider.CatalogFor, i.e. every visible model minus the agent's HiddenModels, each under a claudeLooking alias), but its row offered no way to pick them: the start button stood the opus tier there as 「上次的选择」, and display_name was "Name (provider/model)" with that id again in description. Now Desktop's row (MENU_FROM_LIST in app.js) puts a model button where another agent's start pick stands: it names the first two picked models (+N, or "No models"), its title says Desktop reads the list as it starts so it must be quit and reopened after a change, and it opens the existing per-agent model list (openAgentModels, the am-pop multi-select posting {hidden} to /api/agent-models/claude-desktop), which stays open while several are ticked; the button, the line under the name ("Connected · n models in Claude Desktop's model menu") and, in the tray panel, the row's summary are refilled on each save instead of the row being redrawn; the panel's opened row has the same button under the provider, the expand link says Details, and the opened row's "In Claude Desktop" says the menu lists the models picked here and that Desktop reads it as it starts. The provider switch (default vs magpie) and the tiers are as before. /api/state's model count carries the first three shown models' names (modelCountJSON.Names). desktopNames gives each model its own name and keeps a suffix only where two picked models share one, case-insensitively: the provider id, or the whole id if that still collides; the description is gone. Models added later still show by default, as for every agent's list. zh strings added (no ja). TestClaudeDesktopPickedModels (two providers' DeepSeek V4.1 Flash read "(opencode-go)"/"(relay)" while both are listed, and after relay's, glm-5 and the routing groups are hidden Desktop lists exactly the three left, the DeepSeek plain, while another agent still lists all) and TestDesktopNames are new; the effort and tier tests map Desktop's rows by DesktopCatalogID instead of the description. internal/gui/tests/desktop-model-menu.test.cjs (window and panel, en and zh: the button's names and title, no 「上次的选择」, the list's ticks, unticking GLM-5 posts the whole hidden list and updates button, line and summary while the list stays open, ticking Kimi K3 back, no scroll, no native select) passes in webkit, as do desktop-tiers, agent-models, agent-connect, agent-start-pick, agent-layout, agent-grip, click-scroll, agent-models-all-hidden, agent-model-groups, agent-models-loading, agent-expand-steady, agent-disconnect, agent-tweak-fold, show-unset-agent, tray-cell-click, library-desktop-skills and by-agent. go vet ./internal/..., builds (darwin, GOOS=linux -tags nogui, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. Not tried in real Claude Desktop: that its menu shows the plain names and only the picked models after a restart is from the /v1/models it is served, not seen in the app. 2026-10-04 05:01:12 +08:00