Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.
gateway: Claude Desktop's haiku calls stay on the chat's provider, not another provider's Claude haiku (cybercaius on Discord)
yetone51f66fe8bbe4
diff --git a/docs/subsystems/gateway-routing.md b/docs/subsystems/gateway-routing.mdindex 151f5174c..2260ff7c4 100644--- a/docs/subsystems/gateway-routing.md+++ b/docs/subsystems/gateway-routing.md@@ -281,6 +281,7 @@ recorded as a prediction failure (`noPrediction`).- Claude Code's billing line (`x-anthropic-billing-header: cc_version=…; cc_entrypoint=…; cch=…;`, its own first system block, `cch` changing every turn) goes on only to a Claude model asked on Anthropic's Messages API (`keepsBillingLine` in [`billing_line.go`](../../internal/gateway/billing_line.go): Anthropic's, a relay's, Bedrock's), as Claude Code sent it. Anywhere else it is left out, the rest of the system as sent (`withoutBillingLine`): a vendor's model relayed on Messages (`passthrough`), every translation to Chat, Responses or Gemini (`forwardTranslated`, Claude models too). Kept, a vendor read it as the prompt's first words and its prefix cache missed from byte 0 every turn (#1600, justrun1983: 4% read from DeepSeek's cache behind Command Code's plan). The Claude subscription's run sends its own (`withoutBillingHeader`), another magpie decides for the provider it picks, and Code Assist (Antigravity, Gemini CLI) is sent it as before, which `antigravityTurnsAway` reads (#666). Once Antigravity has turned such a request away, for `agForeseeing` (6 hours) after, a candidate loop with someone left after an Antigravity account skips it for a request that carries the line, without asking it (`antigravityForeseen`, #2156: each Claude Desktop turn waited about a second on the same refusal before the next member). The skip goes in `Fallback` with the hint, nothing rests, and the agent is told the refusal if nobody after it answers but with a quota. The last one left is still asked, and an old refusal foresees nothing, so a block Google lifts is noticed (`TestAntigravityTurnedAwayIsForeseen`). Codex's own identity line for its GPT-5 models ("You are Codex, an agent based on GPT-5", "…a coding agent based on GPT-5", any case) is turned away the same way (`antigravityTurnsCodexAway`): Codex sends its model's prompt as the thread's first developer message, which goes in as the system instruction, and a thread begun on a GPT model keeps it after `/model`, `resume -m` or a fork as an agent's thread, so such a thread on an Antigravity model 429'd until Codex's retry limit while dsh on the same account answered (Jodiezzzzzz on X, 10-27). It gets its own hint (`antigravityCodexHint`: start a new chat on the model, which is sent magpie's own Codex prompt "You are Codex, based on GPT-5.", which Antigravity answers), chosen by `antigravityHint`. Codex sends its `web_search` tool every turn, so an Antigravity model's Codex turn goes through magpie's own search (`searchReply`); its rounds are wrapped in `antigravityRound`, which tells the 429 (or the reply's error event) the same way and marks the attempt, where before the search path returned the bare 429 that Codex retried to its limit.- A request translated to a Chat or Responses upstream that carries no `prompt_cache_key` of the client's (every Anthropic client's) gets one for its conversation when the provider is OpenAI's API with a key or one the user added by its address (`ownCacheKey`, `cacheKeyOf` in [`gateway.go`](../../internal/gateway/gateway.go)): a hash, in a UUID's shape, of the session the client names, else of its first user message, so every turn of it has the same key and nothing in it names the client or magpie. A relay can turn a request away without one ("prompt_cache_key is required", CyberCaius's AnyRouter). A vendor's preset, a signed-in account, a plugin, Bedrock and Vertex get none, nor does a provider whose extraBody names `prompt_cache_key` (the user's value is sent). An upstream whose 400 names the field is asked again without it and not sent it again; another 400 is not asked again for it, so an unrelated refusal is tried as often as before.- Claude Desktop's check that a gateway model answers (`{"max_tokens":1,"messages":[{"role":"user","content":"."}]}`, sent as it starts and by its settings' Test connection on the shortest id it is listed with haiku in it, else sonnet, else opus; `desktopProbe` in [`desktop.go`](../../internal/gateway/desktop.go)) goes to Desktop's default model, the first one listed to it (`desktopDefault`; Desktop's own settings call the first listed model the default), never to the haiku it names, which is another provider's quota, nor to the model the last session ran on (`desktopPicked`), which can be days old: v0.1.1821 sent it there, a relay's GPT model CyberCaius had left for his routing group, and the relay turned it away (Discord, v0.1.1838). It is asked for 16 tokens upstream (`desktopProbeTokens`): OpenAI's models refuse fewer, and a relay in front of one (AnyRouter's "bad response status code 400") passes on no floor for `tokenFloor` to ask again at. A relay that needs `prompt_cache_key` gets one (above). `TestClaudeDesktopProbeToDefaultModel`.+- Claude Desktop's `/v1/models` tags a model with `anthropic_family_tier` only when the user picked it for that tier (`DesktopTiers`, the Agents page's opus, sonnet, haiku and fable). Before, a Claude model magpie served was tagged with its own tier unpicked, so Desktop's Code tab told Claude Code to run its haiku calls (its small, fast model) on whichever provider served a `claude-haiku-…`: a chat on AgentRouter's gpt-6.1-sol sent them to Leee's `claude-haiku-5-5` (cybercaius on Discord). Untagged, Claude Code asks for its own id of the tier. A background call (no tools) or a subagent's turn asking for a Claude model by Claude's own id that is no catalog id (`claudeOwnID`) stays on the chat's provider (`desktopPicked`), even when another provider serves a model of that name: `servedBeside` gives that provider's model of that name, else its newest model of the tier, beside the chat's model first, else the call goes to the chat's model. A lead's turn and an id the user picked for a tier (a catalog id) go as asked. `TestClaudeDesktopBackgroundStaysOnChatProvider`.- Antigravity answers a system instruction holding one of a few lines with a 429 "Resource has been exhausted" whatever quota is left, on every model (`agTurnedAway` in [`codeassist.go`](../../internal/gateway/codeassist.go)): Claude Code's billing line, the Claude Agent SDK's identity line, Codex's identity lines for its GPT-5 models (which a Codex thread begun on a GPT model keeps after a switch), and Hermes Agent's earlier default persona. An Antigravity account's system instruction goes with a zero-width space after each such line's first letter (`antigravityCloak`, in `codeAssistBody`), which Google lets through and the model reads the same; every other provider, Gemini CLI's sign-in on the same envelope included, is sent the prompt as written. `magpie provider set antigravity prompt=as-written` (`Provider.PromptAsWritten`) turns it off. The refusal is still told against the system prompt as the agent wrote it (`antigravityTurnedAway`): a 400 with the hint for that prompt, the account not rested, and a group skipping Antigravity for that prompt for 6 hours after a refusal (`antigravityForeseen`).- Claude Code's advisor (`/advisor`, `--advisor`) is Anthropic's server tool `advisor_20260301`, its `model` named as Claude Code names its own: on magpie, by magpie's id (the tier an alias like `opus` is on), which no vendor knows, so the request was turned away whole (JackChou on Discord). Relayed on Messages (`passthrough`), the advisor's model goes as the upstream's own name for it when it is the same provider's Claude model, or a Claude id naming no provider (`advisorTools` in [`advisor.go`](../../internal/gateway/advisor.go)); one it can't run there (another provider's, a group, not Claude's) is left out, as is every advisor when the request's own model isn't a Claude model (a vendor's Messages API knows no such tool), and the turn is answered without one. A translation drops it with every other server tool. Claude Code (2.1.300) also puts the advisor in the conversation: a `{role: "system"}` message whose text ends in its instructions ("# Advisor Tool … call advisor BEFORE substantive work") and a `tool_addition` naming it. Where the advisor is left out, that `tool_addition` goes too (and a message it leaves empty), and the instructions become Claude Code's own "The advisor tool is no longer available; disregard the earlier advisor instructions." (`withoutAdvisor` on Messages, `advisorGoneIn` in `parseAnthropic` for a translation): left there, the model called `advisor()` as one of the agent's tools and Claude Code answered "No such tool available: advisor" (JackChou on Discord). The Claude subscription's run declares only magpie's tools, so it never has one. `TestAdvisorModelAsTheUpstreamNamesIt`, `TestAdvisorLeftOutOnTranslation`.- Kiro is told where to cache the prompt (plugins#110: a Kiro subscription read 0 from its cache). Its API takes Bedrock's `cachePoint: {"type":"default"}` on a `userInputMessage`, an `assistantResponseMessage` or as a tool entry. The built-in (`buildKiro` in [`kiro.go`](../../internal/gateway/kiro.go)) marks the first message when there is a system prompt, which it folds into that message, and the current message, as `buildAnthropic` marks Anthropic's. A moved Kiro's plugin (opencode-kiro-auth 0.1.10, the mover's `min`) turns each `cache_control` in the Anthropic body it is handed into one, at most 4, the last kept.diff --git a/internal/agent/claudedesktop.go b/internal/agent/claudedesktop.goindex 79ac27a91..ef71406fc 100644--- a/internal/agent/claudedesktop.go+++ b/internal/agent/claudedesktop.go@@ -318,8 +318,9 @@ func desktopKeyApplied(p desktopPaths) error {// desktopTierFields pick the model each of Claude Code's tiers runs on in// Desktop's Code tab, its subagents' sonnet, haiku or opus among them-// (gateway.DesktopTiers). Unset, a Claude model magpie serves stands in for-// its own tier, else the chat's model does. Desktop reads them from the+// (gateway.DesktopTiers). Unset, the chat's provider's model of the tier+// stands in, else the chat's model does: another provider's Claude model+// is never used unpicked. Desktop reads them from the// gateway's /v1/models when it starts.func desktopTierFields(ps []desktopPaths) []Field {var fields []Fielddiff --git a/internal/gateway/desktop.go b/internal/gateway/desktop.goindex 6b0c3f6a1..2edc7a3aa 100644--- a/internal/gateway/desktop.go+++ b/internal/gateway/desktop.go@@ -213,9 +213,14 @@ func DesktopNumber(e provider.Entry) string {// one, which such a build would drop whole (#2426).func desktopModels(entries []provider.Entry, knowsMythos bool) []map[string]any {names := desktopNames(entries)- // the tier each model stands in for: the user's pick (a model picked- // for two is tagged with the first, desktopTierTurn sends the other),- // else a Claude model's own+ // the tier each model stands in for: the user's pick only (a model+ // picked for two is tagged with the first, desktopTierTurn sends the+ // other). A Claude model is never tagged with its own tier unasked:+ // Desktop's Claude Code then sent every haiku call (its small, fast+ // model) to whichever provider served a claude-haiku, Leee's while the+ // chat was on AgentRouter's gpt-6.1-sol (cybercaius on Discord).+ // Untagged, Claude Code asks for its own id of the tier, which+ // desktopTurn keeps on the chat's provider (servedBeside).picked := DesktopTiers()tierOf := map[string]string{}for _, t := range DesktopTierNames {@@ -239,8 +244,6 @@ func desktopModels(entries []provider.Entry, knowsMythos bool) []map[string]any}if t := tierOf[e.ID]; t != "" {m["anthropic_family_tier"], m["is_family_default"] = t, true- } else if t := claudeTier(e.ID); t != "" && picked[t] == "" {- m["anthropic_family_tier"] = t}data = append(data, m)}@@ -287,8 +290,9 @@ const desktop1MSaid = "1M context window"// a subagent on "sonnet" or "haiku" asked for Claude Code's own// claude-sonnet-… and that, unserved, went to the chat's model: every// subagent ran on it, whatever its tier (WilianWeng on Discord). The user-// picks a model per tier in magpie; a Claude model magpie serves stands in-// for its own tier while its tier has none picked.+// picks a model per tier in magpie; a tier with none picked runs on the+// chat's provider's model of that tier, else on the chat's model+// (servedBeside).var DesktopTierNames = []string{"opus", "sonnet", "haiku", "fable"}func desktopTiersPath() string { return filepath.Join(settings.Dir(), "claude-desktop.tiers.json") }@@ -510,11 +514,23 @@ func desktopTurn(asked string, body []byte, byClaudeCode, bySubagent bool) strin}title := !tools && aside && desktopAccepts(asked)gone := unserved(asked)- if gone && !title {+ // Claude Code's own id of a Claude model (claude-haiku-5-5), asked for+ // a background call or a subagent, that some provider serves under+ // that model while the chat is on another: it stays with the chat's+ // provider, as an unserved one does. The user picked one model in+ // Desktop and expects one provider billed, not a Leee haiku beside an+ // AgentRouter chat (cybercaius on Discord). A tier the user picked a+ // model for is tagged in /v1/models, so Claude Code asks for that+ // model by its own id, which is a catalog id and stays as asked.+ elsewhere := !gone && !title && picked != "" && (!tools || bySubagent) && claudeOwnID(asked)+ if (gone || elsewhere) && !title {if m := servedBeside(asked, picked); m != "" {return m}}+ if elsewhere {+ return picked+ }if gone || title {if picked != "" {return picked@@ -533,9 +549,26 @@ func desktopTurn(asked string, body []byte, byClaudeCode, bySubagent bool) strinreturn asked}+// claudeOwnID: asked is a Claude model by Claude's own id+// (claude-haiku-5-5, claude-sonnet-4-6[1m]), which no entry has as its+// catalog id; one may still have it as its model.+func claudeOwnID(asked string) bool {+ bare := strings.TrimSuffix(asked, "[1m]")+ if strings.Contains(bare, "/") || claudeTier(bare) == "" {+ return false+ }+ for _, e := range provider.Catalog() {+ if e.ID == bare {+ return false+ }+ }+ return true+}+// servedBeside is the catalog id the session's provider serves a Claude-// model by that Claude Code asked for by Claude's own id, which no entry-// has as its id or model: another magpie (a Remote magpie provider) lists+// model by that Claude Code asked for by Claude's own id. The provider+// may list it as that model (claude-sonnet-5), or, where no entry has it+// as its id or model: another magpie (a Remote magpie provider) lists// it under its own provider's prefix, office/claude/claude-sonnet-5 with// the model claude/claude-sonnet-5. Its auto mode's classifier asks for// its sonnet by name while the session is on office/claude/claude-opus-5-5,@@ -543,16 +576,36 @@ func desktopTurn(asked string, body []byte, byClaudeCode, bySubagent bool) strin// (#2187, SuInk). Only the provider picked is looked at, so another// provider's model of the same name doesn't take it; of that provider's,// the one beside the picked model (the same subscription there) comes-// first. "" when the session's provider serves no such model.+// first. With no such model, the provider's newest Claude model of the+// same tier stands in (claude-haiku-5-5 for Claude Code's+// claude-haiku-4-5-20251001), so its small calls stay small and on the+// chat's provider. "" when the session's provider serves no model of the+// tier.func servedBeside(asked, picked string) string {bare := strings.TrimSuffix(asked, "[1m]")- if picked == "" || strings.Contains(bare, "/") || claudeTier(bare) == "" {+ tier := claudeTier(bare)+ if picked == "" || strings.Contains(bare, "/") || tier == "" {return ""}cat := provider.Catalog()var pid, dir string+ picked = strings.TrimSuffix(picked, "[1m]")for _, e := range cat {- if e.ID == strings.TrimSuffix(picked, "[1m]") && e.Group == "" {+ if e.ID == picked && e.Group == "" {+ pid = e.Provider.ID+ if i := strings.LastIndex(e.Model, "/"); i >= 0 {+ dir = e.Model[:i+1]+ }+ break+ }+ }+ // a session on a model asked for by its bare name (one an entry has+ // as its model, not its id)+ for _, e := range cat {+ if pid != "" {+ break+ }+ if e.Model == picked && e.Group == "" {pid = e.Provider.IDif i := strings.LastIndex(e.Model, "/"); i >= 0 {dir = e.Model[:i+1]@@ -564,18 +617,39 @@ func servedBeside(asked, picked string) string {return ""}found := ""+ var tierID, tierModel string+ tierBeside := falsefor _, e := range cat {- if e.Group != "" || e.Provider.ID != pid || !strings.HasSuffix(e.Model, "/"+bare) {+ if e.Group != "" || e.Provider.ID != pid {continue}- if dir != "" && e.Model == dir+bare {- return e.ID + strings.TrimPrefix(asked, bare)+ if e.Model == bare || strings.HasSuffix(e.Model, "/"+bare) {+ if e.Model == bare || dir != "" && e.Model == dir+bare {+ return e.ID + strings.TrimPrefix(asked, bare)+ }+ if found == "" {+ found = e.ID + strings.TrimPrefix(asked, bare)+ }+ continue+ }+ // the tier's stand-in: beside the picked model first, then the+ // newest version+ m := claudeModel(e)+ if m == "" || claudeTier(m) != tier {+ continue}- if found == "" {- found = e.ID + strings.TrimPrefix(asked, bare)+ beside := dir != "" && strings.HasPrefix(e.Model, dir)+ if tierID == "" || beside && !tierBeside || beside == tierBeside && m > tierModel {+ tierID, tierModel, tierBeside = e.ID, m, beside}}- return found+ if found != "" {+ return found+ }+ if tierID != "" {+ return tierID + strings.TrimPrefix(asked, bare)+ }+ return ""}// desktopDefault is the model a request Desktop sends before any turn hasdiff --git a/internal/gateway/desktop_remote_classifier_test.go b/internal/gateway/desktop_remote_classifier_test.goindex 592af244a..5c2fee9aa 100644--- a/internal/gateway/desktop_remote_classifier_test.go+++ b/internal/gateway/desktop_remote_classifier_test.go@@ -115,9 +115,14 @@ func TestClaudeDesktopClassifierOnRemoteMagpie(t *testing.T) {if got := send(electron, title); got != "work/claude-opus-5-5" {t.Fatalf("title: sent %q", got)}- // a Claude model the other magpie doesn't serve goes to the session's- if got := send(cli, `{"model":"claude-haiku-4-5","max_tokens":64,"stream":true,"messages":[{"role":"user","content":"hi"}]}`); got != "work/claude-opus-5-5" {- t.Fatalf("unserved: sent %q", got)+ // a Claude model the other magpie doesn't serve goes to its model of+ // the same tier (cybercaius: a haiku call stays a haiku call on the+ // session's provider), and one of a tier it has none of to the session's+ if got := send(cli, `{"model":"claude-haiku-4-5","max_tokens":64,"stream":true,"messages":[{"role":"user","content":"hi"}]}`); got != "work/claude-haiku-5-5" {+ t.Fatalf("unserved haiku: sent %q", got)+ }+ if got := send(cli, `{"model":"claude-fable-5-1","max_tokens":64,"stream":true,"messages":[{"role":"user","content":"hi"}]}`); got != "work/claude-opus-5-5" {+ t.Fatalf("unserved fable: sent %q", got)}}diff --git a/internal/gateway/desktop_tier_provider_test.go b/internal/gateway/desktop_tier_provider_test.gonew file mode 100644index 000000000..b07d4ac68--- /dev/null+++ b/internal/gateway/desktop_tier_provider_test.go@@ -0,0 +1,93 @@+package gateway++import (+ "testing"++ "github.com/yetone/magpie/internal/provider"+)++// cybercaius on Discord: Claude Desktop's chat was on AgentRouter's+// gpt-6.1-sol, and Claude Code's haiku calls in it (its small, fast+// model) went to Leee's claude-haiku-5-5, a provider the user never picked+// in Desktop. /v1/models tagged Leee's haiku with the haiku tier unasked,+// so Claude Code asked for it by name. Untagged, Claude Code asks for its+// own claude-haiku id, which stays on the chat's provider: its model of+// that tier when it has one, else the chat's model. A tier the user picked+// keeps its pick.+func TestClaudeDesktopBackgroundStaysOnChatProvider(t *testing.T) {+ t.Setenv("XDG_CONFIG_HOME", t.TempDir())+ t.Setenv("XDG_CACHE_HOME", t.TempDir())+ desktopPicked.Lock()+ desktopPicked.model, desktopPicked.from = "", ""+ desktopPicked.Unlock()+ for _, p := range []provider.Provider{+ {ID: "agentrouter", Name: "AgentRouter", Key: "k", Anthropic: "http://127.0.0.1:1", Models: []string{"gpt-6.1-sol"}},+ {ID: "leee", Name: "Leee", Key: "k", Anthropic: "http://127.0.0.1:1", Models: []string{"claude-haiku-5-5"}},+ {ID: "claudeish", Name: "Claudeish", Key: "k", Anthropic: "http://127.0.0.1:1", Models: []string{"claude-opus-5-5", "claude-haiku-4-5", "claude-haiku-5-5"}},+ } {+ if err := provider.Save(p); err != nil {+ t.Fatal(err)+ }+ }+ for _, m := range desktopModels(provider.Catalog(), true) {+ if tier, _ := m["anthropic_family_tier"].(string); tier != "" {+ t.Fatalf("%v tagged %q with nothing picked", m["id"], tier)+ }+ }++ turn := []byte(`{"max_tokens":32000,"tools":[{"name":"Bash"}],"messages":[{"role":"user","content":"hi"}]}`)+ small := []byte(`{"max_tokens":3000,"system":[{"type":"text","text":"Summarize."}],"messages":[{"role":"user","content":"…"}]}`)+ sub := []byte(`{"max_tokens":32000,"tools":[{"name":"Read"}],"messages":[{"role":"user","content":"look"}]}`)++ // the chat on AgentRouter's GPT: Claude Code's haiku calls go there,+ // though Leee serves claude-haiku-5-5 by that very name+ if got := desktopTurn("agentrouter/gpt-6.1-sol", turn, true, false); got != "agentrouter/gpt-6.1-sol" {+ t.Fatalf("turn sent %q", got)+ }+ for _, c := range []struct {+ asked string+ body []byte+ sub bool+ }{+ {"claude-haiku-5-5", small, false},+ {"claude-haiku-4-5-20251001", small, false},+ {"claude-haiku-5-5", sub, true},+ } {+ if got := desktopTurn(c.asked, c.body, true, c.sub); got != "agentrouter/gpt-6.1-sol" {+ t.Errorf("chat on AgentRouter, %s (subagent %v) sent to %q", c.asked, c.sub, got)+ }+ }++ // the chat on a provider with haikus of its own: its newest haiku,+ // or the very one asked for when it has it+ if got := desktopTurn("claudeish/claude-opus-5-5", turn, true, false); got != "claudeish/claude-opus-5-5" {+ t.Fatalf("turn sent %q", got)+ }+ for asked, want := range map[string]string{+ "claude-haiku-5-5": "claudeish/claude-haiku-5-5",+ "claude-haiku-4-5": "claudeish/claude-haiku-4-5",+ "claude-haiku-4-5-20251001": "claudeish/claude-haiku-5-5",+ "claude-haiku-9[1m]": "claudeish/claude-haiku-5-5[1m]",+ } {+ if got := desktopTurn(asked, small, true, false); got != want {+ t.Errorf("chat on Claudeish, %s sent to %q, want %q", asked, got, want)+ }+ }++ // a haiku the user picked for the tier is tagged and kept+ if err := SetDesktopTier("haiku", "leee/claude-haiku-5-5"); err != nil {+ t.Fatal(err)+ }+ tagged := false+ for _, m := range desktopModels(provider.Catalog(), true) {+ if DesktopCatalogID(m["id"].(string)) == "leee/claude-haiku-5-5" {+ tagged = m["anthropic_family_tier"] == "haiku" && m["is_family_default"] == true+ }+ }+ if !tagged {+ t.Fatal("the picked haiku isn't tagged")+ }+ if got := desktopTurn("leee/claude-haiku-5-5", small, true, false); got != "leee/claude-haiku-5-5" {+ t.Fatalf("the picked haiku sent to %q", got)+ }+}diff --git a/internal/gateway/desktop_tier_test.go b/internal/gateway/desktop_tier_test.goindex 20637f7cd..6867d1e03 100644--- a/internal/gateway/desktop_tier_test.go+++ b/internal/gateway/desktop_tier_test.go@@ -12,9 +12,11 @@ import (// Claude Desktop's Code tab runs a subagent on a tier only when the// gateway's /v1/models tags a model with it; untagged, every subagent ran on-// the chat's model (WilianWeng). A Claude model is tagged with its own tier,-// a model the user picks for a tier with that one as its default, and Claude-// Code's own id of a tier no row carries goes to the tier's pick.+// the chat's model (WilianWeng). A model the user picks for a tier is tagged+// with it as its default, and Claude Code's own id of a tier no row carries+// goes to the tier's pick. A Claude model is not tagged with its own tier+// unpicked (cybercaius: another provider's haiku took Claude Code's small+// calls).func TestClaudeDesktopTiers(t *testing.T) {f := &fake{reply: sse(`event: message_start`+"\n"+`data: {"type":"message_start","message":{"id":"m","type":"message","role":"assistant","model":"m1","content":[],"usage":{"input_tokens":1,"output_tokens":0}}}`,@@ -63,9 +65,9 @@ func TestClaudeDesktopTiers(t *testing.T) {return modelOf(f.got)}- // nothing picked: the Claude model stands in for its own tier+ // nothing picked: nothing is taggedgot := rows()- if r := got["fake/claude-sonnet-5"]; r.Tier != "sonnet" || r.Default {+ if r := got["fake/claude-sonnet-5"]; r.Tier != "" || r.Default {t.Fatalf("claude-sonnet-5 unpicked: %+v", r)}if r := got["fake/m1"]; r.Tier != "" {diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.jsindex 427090cba..9bcfea863 100644--- a/internal/gui/assets/app.js+++ b/internal/gui/assets/app.js@@ -4032,12 +4032,12 @@ function tierMenu(a) {const omp = ompAgent(a);const tiers = a.fields.filter((f) => menuRoles(a).includes(f.label));if (!tiers.length || !tiers.some((f) => f.options.length)) return null;- // Claude Desktop has no model of its own here: a tier unset runs on a- // Claude model of that tier magpie serves, else on the chat's model+ // Claude Desktop has no model of its own here: a tier unset runs on the+ // chat's provider's model of that tier, else on the chat's modelconst main = a.fields.find((f) => f.key === "model");const mainName = main && (optionFor(main, main.value)?.label || main.value);const unset = (f) => omp && OMP_OWN_PICK.includes(f.label) ? t(OMP_UNSET[f.label])- : main ? t("same as model ({model})", { model: mainName }) : t("a Claude model of the tier, else the chat's model");+ : main ? t("same as model ({model})", { model: mainName }) : t("the chat's provider's model of the tier, else the chat's model");// a tier's effort, offered while there are levels to pick (Claude Code// through magpie); unset, the tier runs at the effort Claude Code asks.// An omp role's thinking level, while the role is on one model; unset,@@ -4925,7 +4925,7 @@ function openPicker(agent, field, anchor, ev, only) {options.unshift(main && claudePicks(agent, field) ? { value: "", label: t(AUTO_MODE_UNSET), note: t("{model} unless the lead or the subagent names another", { model: mainName }), icon: agent.icon, reset: true }: main && leadPicks(agent, field) ? { value: "", label: t("Lead's pick"), note: t("{model} unless the lead names another", { model: mainName }), icon: optionFor(main, main.value)?.icon, reset: true }: main ? { value: "", label: t("Same as model"), note: mainName, icon: optionFor(main, main.value)?.icon, reset: true }- : { value: "", label: t("Not set"), note: t("a Claude model of the tier, else the chat's model"), icon: agent.icon, reset: true });+ : { value: "", label: t("Not set"), note: t("the chat's provider's model of the tier, else the chat's model"), icon: agent.icon, reset: true });} else if (field.label === SUB_MODEL && codexSub(agent) && !options.some((o) => o.value === "")) {const said = codexSubSaid(agent, { ...field, value: "" });const main = agent.fields.find((f) => f.key === "model");diff --git a/internal/gui/assets/i18n.js b/internal/gui/assets/i18n.jsindex 12b64f4ff..0708211c2 100644--- a/internal/gui/assets/i18n.js+++ b/internal/gui/assets/i18n.js@@ -774,7 +774,7 @@ const I18N = {"Claude Code keeps its claude.ai sign-in (/login), so those work; it sends that sign-in to magpie, which never passes it on. Remote Control and ultrareview stay off: Claude Code has them only on Anthropic's own address": "Claude Code 保留 claude.ai 登录(/login),上述功能可用;它把这份登录凭据发给 magpie,magpie 不会转交给任何地方。Remote Control 和 ultrareview 仍不可用:Claude Code 只在 Anthropic 官方地址上提供它们","same as model": "同主模型","same as model ({model})": "同主模型({model})",- "a Claude model of the tier, else the chat's model": "该档位的 Claude 模型,没有则用对话的模型",+ "the chat's provider's model of the tier, else the chat's model": "对话所在供应商的该档位模型,没有则用对话的模型","not set": "未设置","Not set": "未设置","Same as model": "同主模型",@@ -4873,7 +4873,7 @@ const I18N = {"magpie is Codex's provider, with magpie's models only; the Codex app keeps its ChatGPT account (its chats, projects and Chrome control) while the account has room": "magpie 作為 Codex 的供應商,只列出 magpie 的模型;ChatGPT 帳號還有額度時,Codex 應用仍保留該帳號(聊天、專案和 Chrome 控制)","same as model": "同主模型","same as model ({model})": "同主模型({model})",- "a Claude model of the tier, else the chat's model": "該檔位的 Claude 模型,沒有則用對話的模型",+ "the chat's provider's model of the tier, else the chat's model": "對話所在供應商的該檔位模型,沒有則用對話的模型","not set": "未設定","Not set": "未設定","Same as model": "同主模型",@@ -8944,7 +8944,7 @@ const I18N = {"Claude Code keeps its claude.ai sign-in (/login), so those work; it sends that sign-in to magpie, which never passes it on. Remote Control and ultrareview stay off: Claude Code has them only on Anthropic's own address": "Claude Code は claude.ai のサインイン(/login)を保つので、これらが使えます。そのサインインは magpie に送られますが、magpie がほかへ渡すことはありません。Remote Control と ultrareview は引き続き使えません。Claude Code は Anthropic 自身のアドレスでしか提供しません","same as model": "モデルと同じ","same as model ({model})": "モデルと同じ({model})",- "a Claude model of the tier, else the chat's model": "その階層の Claude モデル、なければチャットのモデル",+ "the chat's provider's model of the tier, else the chat's model": "チャットのプロバイダーのその階層のモデル、なければチャットのモデル","not set": "未設定","Not set": "未設定","Same as model": "モデルと同じ",@@ -13029,7 +13029,7 @@ const I18N = {"Claude Code keeps its claude.ai sign-in (/login), so those work; it sends that sign-in to magpie, which never passes it on. Remote Control and ultrareview stay off: Claude Code has them only on Anthropic's own address": "Claude Code bleibt bei claude.ai angemeldet (/login), damit das alles funktioniert; diese Anmeldung geht an magpie, das sie nie weitergibt. Remote Control und ultrareview bleiben aus: Claude Code bietet sie nur unter Anthropics eigener Adresse","same as model": "wie Modell","same as model ({model})": "wie Modell ({model})",- "a Claude model of the tier, else the chat's model": "ein Claude-Modell der Stufe, sonst das Modell des Chats",+ "the chat's provider's model of the tier, else the chat's model": "ein Modell der Stufe vom Anbieter des Chats, sonst das Modell des Chats","not set": "nicht festgelegt","Not set": "Nicht festgelegt","Same as model": "Wie Modell",diff --git a/internal/gui/tests/desktop-tiers.test.cjs b/internal/gui/tests/desktop-tiers.test.cjsindex 6405bb158..70de86cd7 100644--- a/internal/gui/tests/desktop-tiers.test.cjs+++ b/internal/gui/tests/desktop-tiers.test.cjs@@ -52,8 +52,8 @@ function server(lang, sets) {}const W = {- en: { unset: "a Claude model of the tier, else the chat's model", reset: "Not set", summary: "tiers: haiku" },- zh: { unset: "该档位的 Claude 模型,没有则用对话的模型", reset: "未设置", summary: "分档:haiku" },+ en: { unset: "the chat's provider's model of the tier, else the chat's model", reset: "Not set", summary: "tiers: haiku" },+ zh: { unset: "对话所在供应商的该档位模型,没有则用对话的模型", reset: "未设置", summary: "分档:haiku" },};const cd = '.row.agent[data-id="claude-desktop"]';