diff --git a/docs/subsystems/providers-accounts.md b/docs/subsystems/providers-accounts.md index d4edbae39..48c9a40c0 100644 --- a/docs/subsystems/providers-accounts.md +++ b/docs/subsystems/providers-accounts.md @@ -214,6 +214,19 @@ that the upstream does not list are named against all listed names and ids; listed models keep their `Available` names unchanged ([`Exposed`](../../internal/provider/models.go)). +The list a magpie gives another magpie also names, as `magpie_by`, the +provider serving each model there (`Entry.ServedBy`: "routing group" for a +group, and for a model of its own Remote magpie the provider at the start +of that chain), kept as the model's `By` ([`live.go`](../../internal/catalog/live.go)). +A Remote magpie set `upstreamProviders` (the editor's *Model names* tick, +`magpie provider set upstream-providers=on`; lcc580 on X) names each +of its models by it, whatever either magpie's *Provider in model names*: +"DeepSeek Chat · Office › Relay A" (`Entry.Label`, `upstream`), so the same +model from two of the remote's providers can be told apart. Ids stay as +they were, and a remote older than the field names its models as before +(`TestRemoteMagpieUpstreamNames`, `TestServedByAndUpstreamLabel`, +`name-suffix-remote.test.cjs`). + A listed model's window, reply limit and levels come from the vendor's list first; only what it leaves out is filled from models.dev. `Decorate` matches the provider's own catalog by id, then by the same model under diff --git a/internal/catalog/catalog.go b/internal/catalog/catalog.go index bc68f45f6..22799d1a2 100644 --- a/internal/catalog/catalog.go +++ b/internal/catalog/catalog.go @@ -85,6 +85,12 @@ type Model struct { // provider after it (magpie_label): the name Provider in model names // Off has here (ARNO on Discord). Plain string `json:",omitempty"` + // By, on a model of another magpie's list, is the provider that + // magpie names as serving it (magpie_by): its own provider's name, or, + // for a model it has from a magpie further on, the one there, the + // first in the chain. Its Remote magpie's upstream names (Provider's + // UpstreamProviders) say it after the model (lcc580 on X). + By string `json:",omitempty"` // Via, on a model of another magpie's list, is the magpies it passes // through to its vendor, that one last (magpie_via.go) Via []string `json:",omitempty"` diff --git a/internal/catalog/live.go b/internal/catalog/live.go index 32d531769..5d481665c 100644 --- a/internal/catalog/live.go +++ b/internal/catalog/live.go @@ -933,7 +933,7 @@ func fetchPage(ctx context.Context, url, key string, anthropic bool, headers map if len(apis) == 0 { apis = targetAPIs(r.TypeTarget) } - m := Model{ID: id, Name: name, Plain: plain, ImageInput: input, APIs: apis, Draws: drawer, Films: films, Decides: decision, Serves: serves, + m := Model{ID: id, Name: name, Plain: plain, By: strings.TrimSpace(r.By), ImageInput: input, APIs: apis, Draws: drawer, Films: films, Decides: decision, Serves: serves, InputModalities: ins, OutputModalities: outs} if n, ok := r.ContextLength.(float64); ok && n > 0 { m.Context = int(n) @@ -1024,7 +1024,10 @@ type liveModel struct { // another magpie's name for the model with its provider there after // it, and "image", "video" or "decision" for its other models Label string `json:"magpie_label"` - Kind string `json:"kind"` + // the provider serving the model there, the first in a chain of + // magpies (Model.By) + By string `json:"magpie_by"` + Kind string `json:"kind"` // how another magpie searches the web for the model: "native" or // "magpie" (Model.WebSearch) WebSearch string `json:"web_search"` diff --git a/internal/cli/providers_cli.go b/internal/cli/providers_cli.go index d690ea771..9e9fe857c 100644 --- a/internal/cli/providers_cli.go +++ b/internal/cli/providers_cli.go @@ -58,6 +58,9 @@ const providerUsage = `usage: image-files=off sends DeepSeek's API an agent's images inline on every turn; image-files=on, the default, uploads each once (for a day) and names it by its file id + upstream-providers=on, on a Remote magpie, names its models by the + provider serving each there (Claude · Office › RelayA); off, the + default, as that magpie's own list names them patience=2m keeps a request to it alone (not through a group) that long while it is busy or briefly rate limited, asking again after a pause (at most 4m); patience=off hands the agent the error at once; @@ -1216,6 +1219,20 @@ func applyPairs(p *provider.Provider, pairs []string) error { default: return fmt.Errorf("image-files=on|off, not %q", v) } + case "upstream-providers": + // on: a Remote magpie's models named by the provider serving + // each there (Provider.UpstreamProviders, lcc580 on X) + if !p.IsRemoteMagpie() { + return fmt.Errorf("upstream-providers is a Remote magpie's; %s is not one", p.ID) + } + switch strings.ToLower(v) { + case "on", "yes": + p.UpstreamProviders = true + case "off", "no", "default": + p.UpstreamProviders = false + default: + return fmt.Errorf("upstream-providers=on|off, not %q", v) + } case "prompt": // as-written: Antigravity's subscription is sent the system // prompt exactly as the agent wrote it, the lines Google turns diff --git a/internal/gateway/gateway.go b/internal/gateway/gateway.go index fd9294e2a..759d48a46 100644 --- a/internal/gateway/gateway.go +++ b/internal/gateway/gateway.go @@ -1695,6 +1695,10 @@ func (s *Server) listModels(w http.ResponseWriter, r *http.Request) { // magpie that is this one's remote too doesn't take // back its own models (catalog's magpie_via.go) m["magpie_via"] = catalog.ViaHere(viaOf(e)) + // the provider serving it, the first in a chain of + // magpies, for one that names its models by it + // (provider.UpstreamNames, lcc580 on X) + m["magpie_by"] = e.ServedBy() } if ts := tiers[e.ID]; len(ts) > 0 { m["service_tiers"] = ts @@ -1749,6 +1753,7 @@ func (s *Server) listModels(w http.ResponseWriter, r *http.Request) { m["kind"], m["magpie_label"] = "decision", labels[i] m["native_endpoints"] = []string{"/v1/systemone"} m["magpie_via"] = catalog.ViaHere(viaOf(e)) + m["magpie_by"] = e.ServedBy() data = append(data, m) } } diff --git a/internal/gateway/remote_upstream_names_test.go b/internal/gateway/remote_upstream_names_test.go new file mode 100644 index 000000000..326a22c37 --- /dev/null +++ b/internal/gateway/remote_upstream_names_test.go @@ -0,0 +1,115 @@ +package gateway + +import ( + "context" + "encoding/json" + "io" + "net/http" + "net/http/httptest" + "strings" + "testing" + + "github.com/yetone/magpie/internal/provider" +) + +// upstreamList is what another magpie, its own Provider in model names +// Off, lists for this one: DeepSeek Chat from two of its relays, each +// labelled by its name alone, so the agents here saw two "DeepSeek Chat · +// Remote magpie" (lcc580 on X). magpie_by names the provider serving each +// there. +const upstreamList = `{"object":"list","data":[` + + `{"id":"relaya/deepseek-chat","object":"model","owned_by":"relaya","display_name":"DeepSeek Chat","magpie_label":"DeepSeek Chat","magpie_by":"Relay A","native_endpoints":["/v1/chat/completions"],"context_length":128000},` + + `{"id":"relayb/deepseek-chat","object":"model","owned_by":"relayb","display_name":"DeepSeek Chat","magpie_label":"DeepSeek Chat","magpie_by":"Relay B","native_endpoints":["/v1/chat/completions"],"context_length":128000},` + + `{"id":"group/fast","object":"model","owned_by":"relaya","display_name":"Fast","magpie_label":"Fast","magpie_by":"routing group","context_length":128000}]}` + +type listed struct { + ID string `json:"id"` + Label string `json:"magpie_label"` + By string `json:"magpie_by"` +} + +func listFor(t *testing.T, asMagpie bool) map[string]listed { + t.Helper() + rec := httptest.NewRecorder() + req := httptest.NewRequest("GET", "/v1/models", nil) + if asMagpie { + req.Header.Set(provider.DrawersHeader, "1") + } + New().Handler().ServeHTTP(rec, req) + var out struct{ Data []listed } + if err := json.Unmarshal(rec.Body.Bytes(), &out); err != nil { + t.Fatal(err) + } + got := map[string]listed{} + for _, m := range out.Data { + got[m.ID] = m + } + return got +} + +// A Remote magpie's upstream names name each of its models by the +// provider serving it there, whatever either magpie's Provider in model +// names is, and its ids stay as they were. Off, the default, they are +// named as before. Listed on to a third magpie, a model names the provider +// at the start of the chain, not the Remote magpie it came through. +func TestRemoteMagpieUpstreamNames(t *testing.T) { + fresh(t) + remote := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + io.WriteString(w, upstreamList) + })) + t.Cleanup(remote.Close) + id, err := provider.Add(provider.Provider{ID: "office", Name: "Office", Key: "magpie", Preset: provider.RemoteMagpiePreset, Chat: remote.URL}) + if err != nil { + t.Fatal(err) + } + p, _ := provider.Find(id) + if _, err := p.Fetch(context.Background()); err != nil { + t.Fatal(err) + } + t.Cleanup(func() { provider.SetSuffixMode(provider.SuffixOn) }) + set := func(on bool) { + t.Helper() + p, _ := provider.Find(id) + p.UpstreamProviders = on + if err := provider.Save(*p); err != nil { + t.Fatal(err) + } + } + for _, c := range []struct { + on bool + mode string + a, b, group string + }{ + {false, provider.SuffixOn, "DeepSeek Chat · Office", "DeepSeek Chat · Office", "Fast · Office"}, + {false, provider.SuffixOff, "DeepSeek Chat · Office", "DeepSeek Chat · Office", "Fast"}, + {true, provider.SuffixOn, "DeepSeek Chat · Office › Relay A", "DeepSeek Chat · Office › Relay B", "Fast · Office › routing group"}, + {true, provider.SuffixOwn, "DeepSeek Chat · Office › Relay A", "DeepSeek Chat · Office › Relay B", "Fast · Office › routing group"}, + {true, provider.SuffixOff, "DeepSeek Chat · Office › Relay A", "DeepSeek Chat · Office › Relay B", "Fast · Office › routing group"}, + } { + set(c.on) + if err := provider.SetSuffixMode(c.mode); err != nil { + t.Fatal(err) + } + got := listFor(t, false) + a, b, g := got["office/relaya/deepseek-chat"], got["office/relayb/deepseek-chat"], got["office/group/fast"] + if a.Label != c.a || b.Label != c.b || g.Label != c.group { + t.Errorf("upstream names %v, %s: %q, %q, %q; want %q, %q, %q", c.on, c.mode, a.Label, b.Label, g.Label, c.a, c.b, c.group) + } + // an agent's list is told no magpie_by; another magpie's is + if a.By != "" { + t.Errorf("an agent's list has magpie_by %q", a.By) + } + } + // a third magpie is told the provider at the start of the chain + got := listFor(t, true) + for id, want := range map[string]string{"office/relaya/deepseek-chat": "Relay A", "office/relayb/deepseek-chat": "Relay B", "office/group/fast": "routing group"} { + if got[id].By != want { + t.Errorf("%s: magpie_by %q, want %q", id, got[id].By, want) + } + } + // a request still names the model by its id, which goes to the remote + if _, ok := got["office/relaya/deepseek-chat"]; !ok || strings.Contains(got["office/relaya/deepseek-chat"].ID, "›") { + t.Errorf("ids changed: %v", got) + } +} diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.js index 8899748f8..99cf7ba82 100644 --- a/internal/gui/assets/app.js +++ b/internal/gui/assets/app.js @@ -8998,12 +8998,8 @@ const edAlign = new ResizeObserver((es) => { if (!n.isConnected) { edAlign.unobserve(n); continue; } const cs = getComputedStyle(n.parentElement), cols = cs.gridTemplateColumns.split(" "); const lab = cols.length > 1 ? parseFloat(cols[0]) || 0 : 0; - // only when changed, and in an open fold a change after the first a - // frame later: its rows take the column, so set while the observer is - // delivering, the fold's own height changes with it (a label wrapping) - // and the browser reports a loop as a page error (a group's editor - // narrowed with the window). A closed fold only moves its chevron, so - // it follows at once, never a frame out of line + // only when changed; an open fold's later change a frame later, or its + // own height change is reported as an observer loop (a page error) const at = (lab && lab + parseFloat(cs.columnGap)) + "px"; if (n.style.getPropertyValue("--ed-lab") === lab + "px" && n.style.getPropertyValue("--ed-at") === at) continue; const set = () => { n.style.setProperty("--ed-lab", lab + "px"); n.style.setProperty("--ed-at", at); }; @@ -9223,7 +9219,7 @@ function baseAPIOf(p) { // draftOf is a saved provider as its editor's form holds it. function draftOf(p) { - return { id: p.id, name: p.name, preset: p.preset, chat: p.chat, responses: p.responses, anthropic: p.anthropic, gemini: p.gemini || "", catalog: p.catalog, decide: p.decide || "", key: "", api: baseAPIOf(p), chosen: pickedOf(p), none: !!p.noModels, best: !!p.bestInFamily, extra: [], headers: headerRows(p.headers), extraBody: extraBodyText(p.extraBody), replyHeaders: (p.replyHeaders || []).join(", "), passHeaders: (p.passHeaders || []).join(", "), icon: p.icon || "", iconFrom: p.iconFrom || "", fallback: [...(p.fallback || [])], unlisted: !!p.unlisted, hiddenDrawers: [...(p.hiddenDrawers || [])], hiddenVideomakers: [...(p.hiddenVideomakers || [])], searches: !!p.searches, unredacted: !!p.unredacted, countFree: !!p.countFree, billing: p.billing || "", insecureTLS: !!p.insecureTLS, http1: !!p.http1, clientCert: p.clientCert || "", clientKey: p.clientKey || "", serverCA: p.serverCA || "", socket: p.socket || "", limitRestOff: !!p.limitRestOff, passErrors: !!p.passErrors, imageFilesOff: !!p.imageFilesOff, nativeCompaction: !!p.nativeCompaction, passUserAgent: p.passUserAgent !== false, pinUpstream: !!p.pinUpstream, authHeader: p.authHeader || "", balanceURL: p.balanceURL || "", balancePath: p.balancePath || "", balanceMethod: p.balanceMethod || "", modelsURL: p.modelsURL || "", listOff: !!p.listOff, contexts: contextsText(p.contexts), outputs: contextsText(p.outputs), compacts: contextsText(p.compacts), keysUrl: p.keysUrl || "", ...proxyDraft(p), ...concurrencyDraft(p), rateWindows: (p.rateWindows || []).map((w) => ({ ...w })) }; + return { id: p.id, name: p.name, preset: p.preset, chat: p.chat, responses: p.responses, anthropic: p.anthropic, gemini: p.gemini || "", catalog: p.catalog, decide: p.decide || "", key: "", api: baseAPIOf(p), chosen: pickedOf(p), none: !!p.noModels, best: !!p.bestInFamily, extra: [], headers: headerRows(p.headers), extraBody: extraBodyText(p.extraBody), replyHeaders: (p.replyHeaders || []).join(", "), passHeaders: (p.passHeaders || []).join(", "), icon: p.icon || "", iconFrom: p.iconFrom || "", fallback: [...(p.fallback || [])], unlisted: !!p.unlisted, hiddenDrawers: [...(p.hiddenDrawers || [])], hiddenVideomakers: [...(p.hiddenVideomakers || [])], searches: !!p.searches, unredacted: !!p.unredacted, countFree: !!p.countFree, billing: p.billing || "", insecureTLS: !!p.insecureTLS, http1: !!p.http1, clientCert: p.clientCert || "", clientKey: p.clientKey || "", serverCA: p.serverCA || "", socket: p.socket || "", limitRestOff: !!p.limitRestOff, upstreamProviders: !!p.upstreamProviders, passErrors: !!p.passErrors, imageFilesOff: !!p.imageFilesOff, nativeCompaction: !!p.nativeCompaction, passUserAgent: p.passUserAgent !== false, pinUpstream: !!p.pinUpstream, authHeader: p.authHeader || "", balanceURL: p.balanceURL || "", balancePath: p.balancePath || "", balanceMethod: p.balanceMethod || "", modelsURL: p.modelsURL || "", listOff: !!p.listOff, contexts: contextsText(p.contexts), outputs: contextsText(p.outputs), compacts: contextsText(p.compacts), keysUrl: p.keysUrl || "", ...proxyDraft(p), ...concurrencyDraft(p), rateWindows: (p.rateWindows || []).map((w) => ({ ...w })) }; } // duplicateProvider opens the Add form on a copy of p, its key p's unless another is pasted (#268). @@ -9735,6 +9731,13 @@ function drawEditor(p, presetID) { c.onchange = () => (draft.libraryMCP = c.checked); ed.append(...field(t("MCP servers"), l)); } + // lcc580 on X + if ((p?.preset || pr?.id) === "remote-magpie") { + const [l, c] = tick(t("With the provider serving it there"), !!draft.upstreamProviders); + l.classList.add("upstream-providers"); + c.onchange = () => { draft.upstreamProviders = c.checked; draft.onUpstreamProviders?.(); }; + ed.append(...field(t("Model names"), l)); + } // A user-defined provider can have its own picture; presets keep theirs. if (custom) ed.append(...field(t("Icon"), iconPicker(ed), "")); @@ -10233,6 +10236,7 @@ function drawEditor(p, presetID) { if (certTakes()) for (const k of CERT_FIELDS) body[k] = onHTTPS() ? (draft[k] || "").trim() : ""; if (socketable()) body.socket = draft.socket || ""; if (custom) body.limitRestOff = !!draft.limitRestOff; + if ((p?.preset || pr?.id) === "remote-magpie") body.upstreamProviders = !!draft.upstreamProviders; if (p?.takesImageFiles) body.imageFilesOff = !!draft.imageFilesOff; if (p ? p.takesPassErrors : custom) body.passErrors = !!draft.passErrors; if (!decideOnly(p || pr)) body.nativeCompaction = !!draft.nativeCompaction && carriesCompaction(); @@ -11524,12 +11528,15 @@ function renderModels(p) { const sayLabel = (mode) => { const name = prefs[first.id]?.name ?? (first.default ? first.name : ""); const base = name || first.default || first.name || first.id; - let label = suffixed(base, p.name || p.id, !!name, mode); + // named by the provider serving it there (lcc580 on X) + const up = draft.upstreamProviders && first.by && !(name && (mode || suffixMode()) === "own"); + let label = up ? (name || first.plain || base) + " · " + (p.name || p.id) + " › " + first.by : suffixed(base, p.name || p.id, !!name, mode); // a remote magpie's model: its name there (ARNO) - if (!name && first.plain && label === base) label = first.plain; + if (!up && !name && first.plain && label === base) label = first.plain; sfxSaid.textContent = t("Agents’ lists show “{label}”", { label }); }; sayLabel(); + draft.onUpstreamProviders = () => sayLabel(); sfx.dataset.mode = suffixMode(); sfx.drawnAgain = sayLabel; const where = el("button", "text action", t("Change in Settings")); @@ -17063,12 +17070,8 @@ if (mode === "panel") document.addEventListener("visibilitychange", () => { if (panelPeek || panelArranging) { panelPeek = ""; panelArranging = false; renderPanelQuota(); } }); -// The tray panel is four tabs over the one page: the agents, the allowances -// of every subscription and key (the "usage" tab, as it was named before), -// what the requests add up to (the "stats" tab, the window's Requests made -// small) and the gateway's latest requests (routing/client.js draws those). The saved -// profiles open from Profiles at the Agents tab's foot, over the list (a tab -// of their own was one too many). The tab is remembered. +// The tray panel's four tabs: agents, allowances ("usage"), totals ("stats") +// and latest requests; Profiles opens at the Agents tab's foot. const profBtn = $("#profBtn"), profBox = $(".profiles"); function placeProfiles() { if (!profBox.classList.contains("open")) return; @@ -22997,12 +23000,8 @@ function setRoom(v, px) { r.style.height = px + "px"; room.set(v, px); } -// Where what's in the view ends, its padding at the foot included, the room -// aside. Not scrollHeight less the room: scrollHeight is never less than the -// view is tall, so under a list shorter than the view (the agents rolled up -// in a tall window) it counted the empty foot as content, the room made was -// too short to hold the list, and each frame's hold and fit took turns -// adding and taking it away, the list swinging between two places (#355). +// Where the view's content ends, the room aside; never scrollHeight less +// the room, which is never under the view's height (#355). function contentEnd(v) { const top = v.getBoundingClientRect().top - v.scrollTop; let end = 0; diff --git a/internal/gui/assets/i18n.js b/internal/gui/assets/i18n.js index a30fe6745..fbc6f48d2 100644 --- a/internal/gui/assets/i18n.js +++ b/internal/gui/assets/i18n.js @@ -2769,6 +2769,8 @@ const I18N = { "{name} added": "已添加 {name}", "Give it a name": "先起个名字", "Add its MCP servers to the Library": "把它的 MCP 服务器加到资源库", + "Model names": "模型名", + "With the provider serving it there": "带上它那边的供应商(穿透)", "A base URL is needed": "需要填写 Base URL", "Endpoint": "接口地址", "Your resource's endpoint is needed": "需要填写你的资源接口地址", @@ -7698,6 +7700,8 @@ const I18N = { "{name} added": "已新增 {name}", "Give it a name": "先起個名字", "Add its MCP servers to the Library": "把它的 MCP 伺服器加到資源庫", + "Model names": "模型名稱", + "With the provider serving it there": "帶上它那邊的供應商(穿透)", "A base URL is needed": "需要填寫 Base URL", "Endpoint": "端點位址", "Your resource's endpoint is needed": "需要填寫你的資源端點", @@ -12605,6 +12609,8 @@ const I18N = { "{name} added": "{name} を追加しました", "Give it a name": "名前を付けてください", "Add its MCP servers to the Library": "その MCP サーバーをライブラリに追加", + "Model names": "モデル名", + "With the provider serving it there": "向こうで提供しているプロバイダーを付ける", "A base URL is needed": "ベース URL が必要です", "Endpoint": "エンドポイント", "Your resource's endpoint is needed": "リソースのエンドポイントが必要です", @@ -17543,6 +17549,8 @@ const I18N = { "{name} added": "{name} hinzugefügt", "Give it a name": "Vergeben Sie einen Namen", "Add its MCP servers to the Library": "Seine MCP-Server zur Bibliothek hinzufügen", + "Model names": "Modellnamen", + "With the provider serving it there": "Mit dem Anbieter, der es dort bereitstellt", "A base URL is needed": "Eine Basis-URL ist erforderlich", "Endpoint": "Endpunkt", "Your resource's endpoint is needed": "Der Endpunkt Ihrer Ressource ist erforderlich", diff --git a/internal/gui/core_budget_test.go b/internal/gui/core_budget_test.go index 4bddbe67a..45d602b56 100644 --- a/internal/gui/core_budget_test.go +++ b/internal/gui/core_budget_test.go @@ -16,7 +16,7 @@ import ( // raises them and says why in its commit. const ( appScriptBudget = 1_316_874 // app.js: 1,198,239 after Usage left (P2); 1,218,098 with the 10-15 fixes to pages still in the core; 1,232,466 with the provider editor's Advanced fold and every dialog holding its place, the core's own (10-16); 1,250,533 with the quota refresh kept through redraws, the core's own since the tray panel draws it too, plus 1.5% (#2397); 1,269,083 with Free first's option in the provider editor's ROUTINGS, which the Routing page reads too, plus 1.5%; 1,272,726 with the Providers page drawing its last list at once (#1519), the core's page, and the Routing trace's account names read without Object.entries (#1481), plus 1.5%; a dialog growing out of the row that opened it and folding back into it, the core's own since every page's dialogs open through it (10-20); Codex's and Claude Code's own settings moved from Settings into the agent's row on the Agents page, the core's own since the tray panel and the window both draw them (10-20); 1,314,432 with Settings › Privacy's record of what was masked (its summary, the records view and the local model's controls), which belongs to Settings, the core's own, plus 1.5%; 1,336,481 with a provider's Names & levels saying Provider in model names is Settings' and opening it there (joe), and Settings' Image recognition saying where a custom provider's model is marked (nexnull), both in the core's own pages, with no room added (10-23); 1,337,633 with Settings › Models › Replies' Intent classifier timeout (#2934, reyoung), Settings' own row, drawn by waitRow, which the Image generation timeout's row now shares, with no room added; 1,337,735 with the provider editor's link naming a partner's page by its own host (siteHost) instead of usemagpie.ai's /go link, the core's own editor, with no room added (10-23); 1,338,084 with Check in now saying what the press came to (claimed +credits, already today, not available yet) where it said "refreshed" (#3326), the check-in row the tray panel draws too, the core's own, with no room added (10-23); 1,338,929 with a new partner's tile keeping a small dot until it is opened, in the add sheet, the core's own, with no room added (10-23); 1,343,324 with the sidebar's open-page row marked by one shape that moves on a spring (navTopGo), the window's own shell, which every page sits beside, with no room added (10-23); 1,343,465 with a dialog kept centred while its content comes in, until it is pressed (holdModal, every page's dialogs), the core's own, with no room added (10-24); 1,317,486 with what masking did moved out to Insights › Masking (plugins/redact), the budget lowered to it (10-24); 1,321,336 with Codex's one subagent model, its card's square saying plainly what each choice does and a row with a name in its sheet, where two squares read alike (the owner), the Agents page's, which the tray panel draws too, the core's own, with no room added (10-24); 1,321,424 with Settings › Models' Image generation MCP server row beside Image recognition's (JonahFu on X), the two drawn by one helper (mcpRow), Settings' own, with no room added (10-25); 1,321,994 with a provider of the user's set never to rest for a limit (zoecats), the provider editor's Advanced row, the core's own editor, with no room added (10-25); 1,322,289 with Settings › Privacy's Keep a key's form under Mask secrets (Charles Cao on X), Settings' own row, with no room added (10-25); 1,322,537 with no Codex squares beside its named settings rows (the owner), with no room added (10-25); 1,323,401 with the tray panel drawing its last allowances at once and asking for them beside the state (#3160, #3134), the tray panel's, the core's own, and the 4 bytes 84c50f032 added, with no room added (10-25); 1,326,105 with many releases' notes merged into one list by kind, each line with its version (the owner), in the update sheet and What's new, with no room added (10-25); 1,321,319 with Settings › Observability moved out to its plugin (plugins/otel/page.js) and its Langfuse setup there (an X user), the budget lowered to it (10-26); a quota card whose window is used but names no reset no longer saying "Not used yet" (windy on Discord) raised it to 1,321,347, and back to 1,321,319 with Settings' model pickers sharing one row helper (modelOpt) where six kept their own copy, no raise (10-26); 1,325,845 with every slow page's skeletons getting magpie's bird hopping bar to bar (skelBird, the owner after the Plugins page's README), one bird for the window over whatever page or dialog is loading, the core's own, with no room added (10-26); 1,310,129 with Settings › Network and sharing's gateway rows (its port, bare ids, local network, allowed addresses, web pages) moved out to the gateway plugin (plugins/gateway/settings.js), the budget lowered to it (10-27); 1,310,269 with Test models naming the first model that failed and its error in the status line, where it said only how many (ysm119 on Discord), the provider editor's, the core's own, with no room added (10-27); 1,310,460 with Settings › About's Website row linking usemagpie.ai (the owner), Settings' own row, with no room added (10-27); 1,309,669 with a pool's Stop at the caps and Check usage near a cap ticks under a provider's accounts (plugins#349), the core's own editor, its account rows' Remove and add rows each drawn by one helper (forgetOf, addRow), with no room added (10-28); 1,311,681 with Install another agent on the Agents page naming the agents Plugins has (More in Plugins) and opening Plugins at its Agents (the owner), the Agents page's, the core's own, with no room added (10-28); 1,311,735 with More in Plugins in sight while Install another agent is folded (the owner), with no room added (10-29); 1,313,704 with a window whose WebKit scrolls under wheels it never tells of (macOS 13) remembered once seen, a scroll at rest then waiting 120ms for a second the same way within 80ms before it is put back, kept for a late wheel to give back (waitsBack), and a load landing under the wheel keeping the reader's way (backAfterLoad, issennknight), the window's own scroll guard, with no room added (10-29); back to 1,311,735 with Settings › Models › Web search's rows (renderSearch, renderSearcher, the search APIs' keys) moved out to the search plugin (plugins/search/settings.js), app.js 1,292,527 after it, not lowered further since what is left plus 1.5% is over it (#4133, 10-29); 1,315,316 with the Agents row of a Claude Code or Codex not connected saying the account it is signed in to and switching it to another (Switch accounts only, the owner on X), in place of the failover line's ChatGPT accounts button, the Agents page's, the core's own, its comments cut down, with no room added (10-30); 1,317,705 with a Claude account added from a setup-token (sfss5362 on X): the sign-in's Use a setup-token instead…, its sheet, and its account row's magpie only, the provider editor's account rows, the core's own editor, its comments cut down, with no room added (10-30); back to 1,315,316 with the setup-token sheet and Copilot's GHE.com one moved out to signsheets.js, loaded when one is asked for (signAsk, 10-30); 1,315,479 with the provider editor lining its Advanced up with its fields (the owner: 高级这个折叠按钮为什么在一个前不着村后不着店的位置?) and a refresh on each of its accounts (在这里也要加上手动刷新用量的按钮), the core's own editor, with no room added (10-31); 1,315,603 with About's Log row, the path of the log the app writes and an Open for its folder (rayem1w on X), in app.js, its comment cut to one line, with no room added (10-31); 1,316,781 with a provider's model listed by an id of the user's (zeewell on X), the provider editor's Names & levels Listed as box beside Same as, the core's own editor, with no room added (10-31); 1,316,874 with a package manager's magpie (the AUR's magpie-bin) naming the command that updates it in Settings' Version row and lighting no Update pill (shuhai on Discord), the core's own update row, which the tray panel reads too, its comments cut to one line, with no room added (10-31); Settings › Sync's Kept on this computer row (hayden4608 on Discord) raised it to 1,317,497, which is no bound; the 1,316,874 it had came back once later trims left app.js at 1,308,363 (10-31) - coreScriptBudget = 1_533_802 // every core script: 1,358,034 after Usage left; 1,380,003 with them; 1,405,937 with the fold; 1,426,102 with 10-16's core work (the GitHub list loading, the move to plugins, Settings › Long conversations), plus 1.5% (#2612); 1,447,368 with loadBack, the window's one state read per return, which every page needs and so is the core's own (1,446,845 before it, 155 bytes under), plus 1.5%; OpenCode Zen's card saying OpenCode tells no key its balance adds ~390 bytes inside it; 1,472,589 with the dialog that grows out of its row and the agents' own settings in their rows, on main's 10-20 core work (the Providers page's last list, the Routing trace's names), plus 1.5% (10-20); 1,506,192 with Settings › Privacy's record of what was masked, plus 1.5%; 1,529,393 with the Intent classifier timeout row (#2934), with no room added; 1,529,495 with the editor's partner link host, with no room added; 1,529,844 with Check in now's press summary (#3326), with no room added; 1,530,689 with the new partner tile's dot, with no room added; 1,535,084 with the sidebar's spring, with no room added; 1,549,478 with the context window card's map (tiles by tokens, the default look, the block grid a switch away) and its text view showing an inline image, in context.js, which the Routing page draws as well as Usage, so the core's own, with no room added (10-24); 1,550,768 with a usage card's refresh opening after its text (#840's card, which the tray panel draws too), the Add key spinner, and a dialog kept centred while its content comes in, with no room added (10-24); 1,524,789 with what masking did moved out to Insights › Masking, lowered to it; 1,528,525 with Codex's one subagent model, with no room added (10-24); 1,528,972 with the Image generation MCP server row (JonahFu on X), with no room added (10-25); 1,529,542 with the limit-rest row (zoecats), with no room added (10-25); 1,529,837 with Keep a key's form (Charles Cao on X), with no room added (10-25); 1,530,050 with no Codex squares beside its named settings rows (the owner), with no room added (10-25); 1,530,631 with a plugin's page growing to its README on the dialog's spring instead of in one jump (the owner), the Plugins page's, in plugins.js, with no room added (10-25); 1,533,445 with the context map counting its tokens on as a live request grows, a tile pointed at keeping its tip, a tool's gathered results saying how many and the small files their folder (the owner, after flohoeller's map on X), in context.js, which the Routing page draws as well as Usage, and the 4 bytes 84c50f032 added to app.js (Settings' Version row) without a raise, with no room added (10-25); 1,534,312 with the tray panel's last allowances drawn at once (#3160, #3134), with no room added (10-25); 1,537,016 with many releases' notes merged into one list by kind (the owner), in app.js, with no room added (10-25); 1,542,244 with a plugin's README loading under magpie's bird bouncing down its lines instead of pulsing bars (the owner), the Plugins page's, in plugins.js, with no room added (10-26); 1,542,418 with a page plugin's sidebar tab coming and going as it is installed, switched on or off, or removed, instead of on the Plugins page's next load (the owner), in plugins.js, with no room added (10-26); 1,537,645 with Settings › Observability moved out to plugins/otel, lowered to it (10-26); 1,537,673 with a used window with no reset not "Not used yet" (windy on Discord), and back to 1,537,645 with Settings' model pickers sharing modelOpt (10-26); 1,541,967 with every slow page's skeletons getting magpie's bird (skelBird, the owner), in app.js, the README's bird sharing its drawing and styles, with no room added (10-26); 1,526,251 with Settings' gateway rows moved out to plugins/gateway/settings.js, lowered to it (10-27); 1,526,391 with Test models naming the first failed model and its error (ysm119 on Discord), in app.js, with no room added (10-27); 1,526,556 with About's Website row (the owner), in app.js, with no room added (10-27); 1,526,500 with a pool's cap ticks (plugins#349), in app.js, with no room added (10-28); 1,527,245 with About's Open-source licenses row and dialog (the owner), in app.js, with no room added (10-28); 1,528,076 with the Partners heading's light (the owner), in app.js, with no room added (10-28); 1,530,449 with Install another agent's More in Plugins row (the owner), in app.js, and Plugins opening at its Agents, in plugins.js, with no room added (10-28); 1,530,807 with layout.js measuring the scrollbar into --bar, which every page's right padding takes off so its sides match (the owner), the window's own shell, with no room added (10-28); 1,530,861 with More in Plugins in sight while Install another agent is folded (the owner), in app.js, with no room added (10-29); 1,532,830 with waitsBack and backAfterLoad (issennknight, macOS 13), the window's own scroll guard, in app.js, with no room added (10-29); the context map's tile wording (a4e929212) and Cindy's Add magpie (628ac36fc) had taken the core over it, and Web search's rows moved out to plugins/search/settings.js brought it back to 1,530,861 (#4133, 10-29); 1,532,459 with a provider editor's account rows on one line each, First or Make first at its right end and the settings that aren't set under ⋯ (the owner), the core's own editor, in app.js, which stays in its budget with its comments cut down, with no room added (10-29); 1,532,602 with a plugin's README waiting for its bird to land on three lines before it goes in, however soon it came (the owner, 10-30), in plugins.js, with no room added; 1,536,357 with Switch accounts only on the Agents row (the owner on X), in app.js, with no room added (10-30); 1,537,034 with a plugin's README read once shown at once, with no bird, when its page opens again and read again behind it, the last 20 kept (the owner), in plugins.js, with no room added (10-30); 1,539,423 with a Claude account added from a setup-token (sfss5362 on X), in app.js, with no room added (10-30); 1,538,975 with purposes.js written as compact JSON by genpurposes and the MCP tool purpose in it, 448 bytes less in all (ferock on Discord), lowered to it (10-30); 1,536,586 with the setup-token sheet and Copilot's GHE.com one moved out to signsheets.js, lowered by the 2,389 the setup-token raised it (10-30); 1,536,631 with the 45 bytes b62fa332f added to app.js (Send requests unmasked for subscriptions and plugin providers too) without a raise, with no room added (10-31); 1,537,356 with Settings › Models › Replies › Claude Code's interactive mode, a row beside Short Claude system prompt (the owner), in app.js, with no room added (10-31); Long conversations in Codex's row naming the config.toml keys Codex reads before it, with Take it out, and the window magpie tells Codex for the model it runs (zgjfjfl on Discord) raised it to 1,537,669, and it is back under 1,537,356 with the key list and the window's size written by the server (codexKeysText, tokensSize) and the row's words cut, no raise (10-31); 1,538,554 with the same two, with no room added (10-31); 1,538,678 with About's Log row (rayem1w on X), with no room added (10-31); 1,539,856 with a model's Listed as id (zeewell on X), in app.js, with no room added (10-31); Tuned for you's Codex row offering the advice to background compaction (herman_hong on Discord) and a package manager's magpie naming its command (shuhai on Discord) took it to 1,541,798, and the release notes' dialogs (What's new, the update's ask) moved out to whatsnew.js, loaded when one opens, brought it back under 1,539,856, no raise (10-31); 1,540,479 for Settings › Sync's Kept on this computer row (hayden4608 on Discord) was taken back to 1,539,856 once the core weighed 1,533,355, no raise (10-31); 1,532,958 with the context window card's head naming the agent and the model's lab (the owner), in context.js, after the card's part text viewer moved out to ctxtext.js (7,005 bytes), lowered to it (10-31); 1,533,105 with the provider editor's Claude Code runs as row moved above the accounts, its pill and hover card in claudemode.js, and Settings found at the row that draws anew (the owner), in app.js and i18n.js, with no room added (11-01); a Codex account's credits spent only after every other account, key and fallback (gokoshiki on Discord) fit in it with the Codex options' comments in app.js cut down, no raise (11-01); a plugin option's words in the window's language and the filtered-models note (plugins#590, anewuser6937 on Discord) fit in it with three of the provider editor's comments in app.js cut down, no raise (11-01); 1,533,802 with a closed Mac window telling its page it is out of sight (#4293, pipi-1997), in app.js, which every page needs, its comments cut to one line, with no room added (11-01); Warm up on a Codex or Claude account's Usage card (01huadalang on Discord), in plugins/usage/page.js, its one call in app.js paid for by two comments cut, no raise (11-01); Settings' Check in now for one account (xiaowu_95660), its row and press in checkinnow.js, loaded when Settings draws a check-in, its one call in app.js paid for by three check-in comments cut, no raise (11-02); a ChatGPT account's plan end under its row on Providers (danzi002 on Discord), its line in app.js paid for by two account-row comments cut, no raise (11-02); Scroll to top and Scroll to bottom (#1090, emo172), in scrollends.js, imported on the window's first scroll, its one line in app.js paid for by two comments cut, no raise (11-02); a new-api relay's User ID beside the balance token (zxc56823), in app.js, paid for by four comments cut, no raise (11-03); Air's opened rows saying whether Air's own Codex and Claude Agent go through magpie (jumy_18634 on Discord), in app.js, paid for by six Agents-page comments cut, no raise (11-03); a key's spend cap on its row (sparkling_lemur_62868 on Discord), its pill and held line in keyspend.js, loaded when the provider editor draws a key, its one call in app.js, no raise (11-03); Claude Code's status line square beside ultracode (steven_4422 on Discord), in app.js, paid for by foldSame's comment cut, no raise (11-03); Codex's Restart the app when magpie switches its account tick (atom0964 on Discord), in app.js, paid for by five account-row comments cut, no raise (11-03); over it at 1,534,154 (#5139), 1,533,125 at e928b57f0, 677 bytes under it, and 1,525,207 with Settings › Sync's server form (davForm: WebDAV, S3 and GitHub) moved out to syncfiles.js, loaded when it opens, not lowered since what is left plus 1.5% is over it (11-04); a Mac window's page letting go of its layers after 30s out of sight (#5530, Matrix on Discord), in app.js, paid for by four comments cut, no raise (11-06); a plugin's tools hidden from every agent from its Plugins row (chengming0v0 on Discord), in plugins.js, paid for by two comments cut, no raise (11-07); a key's balance typed by hand (tenacious_eagle on Discord), its pill in keybalance.js, loaded by keyspend.js when the provider editor draws a key of a provider that takes one, nothing in app.js, no raise (11-08); a key's provider's model list off (axelburks on Discord), its tick in app.js, paid for by four Models-section comments cut, no raise (11-08); a model's own headers in Model settings (axelburks on Discord), the core's own editor, paid for by sixteen of its comments cut, no raise (11-08); a model asked on System One (axelburks on Discord), in app.js, paid for by three of the editor's comments cut, no raise (11-08); a typed balance's part that expires (tenacious_eagle_96548 on Discord), its days on the Usage page and the panel in app.js (expiresIn), paid for by five balance comments cut, no raise (11-08); a model's context window and max output in its Model settings row (sayagoodbyeplz on Discord), the row's boxes in modellimits.js, loaded when the provider editor draws a model, its one call in app.js paid for by nine comments cut, no raise (11-08); Make first under Smart saying the order only settles ties (CryptoSarom on X, 4436b7d98, 1,080 bytes in app.js) took it to 1,534,166 (#5720), and About's Open-source licenses dialog moved out to notices.js and Sync's Restore and Upload asks to syncfiles.js, each loaded when it opens, brought it back to 1,530,548, no raise (11-09); a subscription's warm-ups, check-ins and resets moved from Settings into its provider's editor (the owner, 11-07), in app.js, paid for by comments cut, no raise (11-09); Settings › Models › Images' Video generation (a custom provider's video model, Discord #feedback), its row in videogen.js, loaded when Settings draws Image generation, its one call in app.js, no raise (11-09); a window's cap at an amount of its unit (9won_25273 on Discord, 40cbdaa7e) took it to 1,535,556 (#5795), and the account-cap rows' comments cut brought it back to 1,533,547, no raise (11-09); Claude Desktop's Claude Magpie switch (#5671, baranwang on X), in app.js, one switch helper shared with the largest-window one and four comments cut, no raise (11-09); a plugin's page sharing a picture it drew (the day card, JungleyYeh on X), its copy and save in pageshare.js, loaded the first time a page shares one, its one call in pluginpages.js paid for by two of its comments cut, no raise (11-09); the quick panel wording unpriced calls as the Usage page does (tenacious_eagle on Discord), in app.js, paid for by four of the panel's comments cut, no raise (11-10); the Codex reset note naming its ChatGPT projects and chats (b3a57b3d8), paid for by appBackSaid's comment cut, no raise (11-10); the daily check-in's time of day (times_ang on X), its row in checkinnow.js, its one call in app.js, went over it at 1,534,281 on a main that had grown under it, and six check-in comments cut brought it back to 1,533,495, no raise (11-10); Codex's service tier row (JackyFill on X), in app.js, paid for by eight Codex-row comments cut, no raise (11-10); the panel's Usage tab putting a vendor's account first from its count (RealZeroP27 on X), its menu in panelfirst.js, loaded when the count is pressed, paid for by the Allowances tab's arranging moved out to panelarrange.js, loaded when Arrange is pressed, no comments cut, no raise (11-10); an agent's own telemetry off in its settings (OipsAnthony on X), in app.js, paid for by sixteen Agents-page comments cut, 1,532,840 after, no raise (11-10); the provider editor's URL taking the /v1 a test found it was typed without (Cyrus_4433 on X), in app.js, paid for by five provider-test comments cut, 1,533,689 after, no raise (11-10); 1,528,998 with the Agents page's Manage agents dialog moved out to agentsmanager.js, loaded when Manage is pressed (11-10); 1,529,335 with an agent's own Provider in model names in agentsuffix.js, loaded when its Details open, and the line that loads it (KillTry27355 on X), no raise (11-10) + coreScriptBudget = 1_533_802 // every core script: 1,358,034 after Usage left; 1,380,003 with them; 1,405,937 with the fold; 1,426,102 with 10-16's core work (the GitHub list loading, the move to plugins, Settings › Long conversations), plus 1.5% (#2612); 1,447,368 with loadBack, the window's one state read per return, which every page needs and so is the core's own (1,446,845 before it, 155 bytes under), plus 1.5%; OpenCode Zen's card saying OpenCode tells no key its balance adds ~390 bytes inside it; 1,472,589 with the dialog that grows out of its row and the agents' own settings in their rows, on main's 10-20 core work (the Providers page's last list, the Routing trace's names), plus 1.5% (10-20); 1,506,192 with Settings › Privacy's record of what was masked, plus 1.5%; 1,529,393 with the Intent classifier timeout row (#2934), with no room added; 1,529,495 with the editor's partner link host, with no room added; 1,529,844 with Check in now's press summary (#3326), with no room added; 1,530,689 with the new partner tile's dot, with no room added; 1,535,084 with the sidebar's spring, with no room added; 1,549,478 with the context window card's map (tiles by tokens, the default look, the block grid a switch away) and its text view showing an inline image, in context.js, which the Routing page draws as well as Usage, so the core's own, with no room added (10-24); 1,550,768 with a usage card's refresh opening after its text (#840's card, which the tray panel draws too), the Add key spinner, and a dialog kept centred while its content comes in, with no room added (10-24); 1,524,789 with what masking did moved out to Insights › Masking, lowered to it; 1,528,525 with Codex's one subagent model, with no room added (10-24); 1,528,972 with the Image generation MCP server row (JonahFu on X), with no room added (10-25); 1,529,542 with the limit-rest row (zoecats), with no room added (10-25); 1,529,837 with Keep a key's form (Charles Cao on X), with no room added (10-25); 1,530,050 with no Codex squares beside its named settings rows (the owner), with no room added (10-25); 1,530,631 with a plugin's page growing to its README on the dialog's spring instead of in one jump (the owner), the Plugins page's, in plugins.js, with no room added (10-25); 1,533,445 with the context map counting its tokens on as a live request grows, a tile pointed at keeping its tip, a tool's gathered results saying how many and the small files their folder (the owner, after flohoeller's map on X), in context.js, which the Routing page draws as well as Usage, and the 4 bytes 84c50f032 added to app.js (Settings' Version row) without a raise, with no room added (10-25); 1,534,312 with the tray panel's last allowances drawn at once (#3160, #3134), with no room added (10-25); 1,537,016 with many releases' notes merged into one list by kind (the owner), in app.js, with no room added (10-25); 1,542,244 with a plugin's README loading under magpie's bird bouncing down its lines instead of pulsing bars (the owner), the Plugins page's, in plugins.js, with no room added (10-26); 1,542,418 with a page plugin's sidebar tab coming and going as it is installed, switched on or off, or removed, instead of on the Plugins page's next load (the owner), in plugins.js, with no room added (10-26); 1,537,645 with Settings › Observability moved out to plugins/otel, lowered to it (10-26); 1,537,673 with a used window with no reset not "Not used yet" (windy on Discord), and back to 1,537,645 with Settings' model pickers sharing modelOpt (10-26); 1,541,967 with every slow page's skeletons getting magpie's bird (skelBird, the owner), in app.js, the README's bird sharing its drawing and styles, with no room added (10-26); 1,526,251 with Settings' gateway rows moved out to plugins/gateway/settings.js, lowered to it (10-27); 1,526,391 with Test models naming the first failed model and its error (ysm119 on Discord), in app.js, with no room added (10-27); 1,526,556 with About's Website row (the owner), in app.js, with no room added (10-27); 1,526,500 with a pool's cap ticks (plugins#349), in app.js, with no room added (10-28); 1,527,245 with About's Open-source licenses row and dialog (the owner), in app.js, with no room added (10-28); 1,528,076 with the Partners heading's light (the owner), in app.js, with no room added (10-28); 1,530,449 with Install another agent's More in Plugins row (the owner), in app.js, and Plugins opening at its Agents, in plugins.js, with no room added (10-28); 1,530,807 with layout.js measuring the scrollbar into --bar, which every page's right padding takes off so its sides match (the owner), the window's own shell, with no room added (10-28); 1,530,861 with More in Plugins in sight while Install another agent is folded (the owner), in app.js, with no room added (10-29); 1,532,830 with waitsBack and backAfterLoad (issennknight, macOS 13), the window's own scroll guard, in app.js, with no room added (10-29); the context map's tile wording (a4e929212) and Cindy's Add magpie (628ac36fc) had taken the core over it, and Web search's rows moved out to plugins/search/settings.js brought it back to 1,530,861 (#4133, 10-29); 1,532,459 with a provider editor's account rows on one line each, First or Make first at its right end and the settings that aren't set under ⋯ (the owner), the core's own editor, in app.js, which stays in its budget with its comments cut down, with no room added (10-29); 1,532,602 with a plugin's README waiting for its bird to land on three lines before it goes in, however soon it came (the owner, 10-30), in plugins.js, with no room added; 1,536,357 with Switch accounts only on the Agents row (the owner on X), in app.js, with no room added (10-30); 1,537,034 with a plugin's README read once shown at once, with no bird, when its page opens again and read again behind it, the last 20 kept (the owner), in plugins.js, with no room added (10-30); 1,539,423 with a Claude account added from a setup-token (sfss5362 on X), in app.js, with no room added (10-30); 1,538,975 with purposes.js written as compact JSON by genpurposes and the MCP tool purpose in it, 448 bytes less in all (ferock on Discord), lowered to it (10-30); 1,536,586 with the setup-token sheet and Copilot's GHE.com one moved out to signsheets.js, lowered by the 2,389 the setup-token raised it (10-30); 1,536,631 with the 45 bytes b62fa332f added to app.js (Send requests unmasked for subscriptions and plugin providers too) without a raise, with no room added (10-31); 1,537,356 with Settings › Models › Replies › Claude Code's interactive mode, a row beside Short Claude system prompt (the owner), in app.js, with no room added (10-31); Long conversations in Codex's row naming the config.toml keys Codex reads before it, with Take it out, and the window magpie tells Codex for the model it runs (zgjfjfl on Discord) raised it to 1,537,669, and it is back under 1,537,356 with the key list and the window's size written by the server (codexKeysText, tokensSize) and the row's words cut, no raise (10-31); 1,538,554 with the same two, with no room added (10-31); 1,538,678 with About's Log row (rayem1w on X), with no room added (10-31); 1,539,856 with a model's Listed as id (zeewell on X), in app.js, with no room added (10-31); Tuned for you's Codex row offering the advice to background compaction (herman_hong on Discord) and a package manager's magpie naming its command (shuhai on Discord) took it to 1,541,798, and the release notes' dialogs (What's new, the update's ask) moved out to whatsnew.js, loaded when one opens, brought it back under 1,539,856, no raise (10-31); 1,540,479 for Settings › Sync's Kept on this computer row (hayden4608 on Discord) was taken back to 1,539,856 once the core weighed 1,533,355, no raise (10-31); 1,532,958 with the context window card's head naming the agent and the model's lab (the owner), in context.js, after the card's part text viewer moved out to ctxtext.js (7,005 bytes), lowered to it (10-31); 1,533,105 with the provider editor's Claude Code runs as row moved above the accounts, its pill and hover card in claudemode.js, and Settings found at the row that draws anew (the owner), in app.js and i18n.js, with no room added (11-01); a Codex account's credits spent only after every other account, key and fallback (gokoshiki on Discord) fit in it with the Codex options' comments in app.js cut down, no raise (11-01); a plugin option's words in the window's language and the filtered-models note (plugins#590, anewuser6937 on Discord) fit in it with three of the provider editor's comments in app.js cut down, no raise (11-01); 1,533,802 with a closed Mac window telling its page it is out of sight (#4293, pipi-1997), in app.js, which every page needs, its comments cut to one line, with no room added (11-01); Warm up on a Codex or Claude account's Usage card (01huadalang on Discord), in plugins/usage/page.js, its one call in app.js paid for by two comments cut, no raise (11-01); Settings' Check in now for one account (xiaowu_95660), its row and press in checkinnow.js, loaded when Settings draws a check-in, its one call in app.js paid for by three check-in comments cut, no raise (11-02); a ChatGPT account's plan end under its row on Providers (danzi002 on Discord), its line in app.js paid for by two account-row comments cut, no raise (11-02); Scroll to top and Scroll to bottom (#1090, emo172), in scrollends.js, imported on the window's first scroll, its one line in app.js paid for by two comments cut, no raise (11-02); a new-api relay's User ID beside the balance token (zxc56823), in app.js, paid for by four comments cut, no raise (11-03); Air's opened rows saying whether Air's own Codex and Claude Agent go through magpie (jumy_18634 on Discord), in app.js, paid for by six Agents-page comments cut, no raise (11-03); a key's spend cap on its row (sparkling_lemur_62868 on Discord), its pill and held line in keyspend.js, loaded when the provider editor draws a key, its one call in app.js, no raise (11-03); Claude Code's status line square beside ultracode (steven_4422 on Discord), in app.js, paid for by foldSame's comment cut, no raise (11-03); Codex's Restart the app when magpie switches its account tick (atom0964 on Discord), in app.js, paid for by five account-row comments cut, no raise (11-03); over it at 1,534,154 (#5139), 1,533,125 at e928b57f0, 677 bytes under it, and 1,525,207 with Settings › Sync's server form (davForm: WebDAV, S3 and GitHub) moved out to syncfiles.js, loaded when it opens, not lowered since what is left plus 1.5% is over it (11-04); a Mac window's page letting go of its layers after 30s out of sight (#5530, Matrix on Discord), in app.js, paid for by four comments cut, no raise (11-06); a plugin's tools hidden from every agent from its Plugins row (chengming0v0 on Discord), in plugins.js, paid for by two comments cut, no raise (11-07); a key's balance typed by hand (tenacious_eagle on Discord), its pill in keybalance.js, loaded by keyspend.js when the provider editor draws a key of a provider that takes one, nothing in app.js, no raise (11-08); a key's provider's model list off (axelburks on Discord), its tick in app.js, paid for by four Models-section comments cut, no raise (11-08); a model's own headers in Model settings (axelburks on Discord), the core's own editor, paid for by sixteen of its comments cut, no raise (11-08); a model asked on System One (axelburks on Discord), in app.js, paid for by three of the editor's comments cut, no raise (11-08); a typed balance's part that expires (tenacious_eagle_96548 on Discord), its days on the Usage page and the panel in app.js (expiresIn), paid for by five balance comments cut, no raise (11-08); a model's context window and max output in its Model settings row (sayagoodbyeplz on Discord), the row's boxes in modellimits.js, loaded when the provider editor draws a model, its one call in app.js paid for by nine comments cut, no raise (11-08); Make first under Smart saying the order only settles ties (CryptoSarom on X, 4436b7d98, 1,080 bytes in app.js) took it to 1,534,166 (#5720), and About's Open-source licenses dialog moved out to notices.js and Sync's Restore and Upload asks to syncfiles.js, each loaded when it opens, brought it back to 1,530,548, no raise (11-09); a subscription's warm-ups, check-ins and resets moved from Settings into its provider's editor (the owner, 11-07), in app.js, paid for by comments cut, no raise (11-09); Settings › Models › Images' Video generation (a custom provider's video model, Discord #feedback), its row in videogen.js, loaded when Settings draws Image generation, its one call in app.js, no raise (11-09); a window's cap at an amount of its unit (9won_25273 on Discord, 40cbdaa7e) took it to 1,535,556 (#5795), and the account-cap rows' comments cut brought it back to 1,533,547, no raise (11-09); Claude Desktop's Claude Magpie switch (#5671, baranwang on X), in app.js, one switch helper shared with the largest-window one and four comments cut, no raise (11-09); a plugin's page sharing a picture it drew (the day card, JungleyYeh on X), its copy and save in pageshare.js, loaded the first time a page shares one, its one call in pluginpages.js paid for by two of its comments cut, no raise (11-09); the quick panel wording unpriced calls as the Usage page does (tenacious_eagle on Discord), in app.js, paid for by four of the panel's comments cut, no raise (11-10); the Codex reset note naming its ChatGPT projects and chats (b3a57b3d8), paid for by appBackSaid's comment cut, no raise (11-10); the daily check-in's time of day (times_ang on X), its row in checkinnow.js, its one call in app.js, went over it at 1,534,281 on a main that had grown under it, and six check-in comments cut brought it back to 1,533,495, no raise (11-10); Codex's service tier row (JackyFill on X), in app.js, paid for by eight Codex-row comments cut, no raise (11-10); the panel's Usage tab putting a vendor's account first from its count (RealZeroP27 on X), its menu in panelfirst.js, loaded when the count is pressed, paid for by the Allowances tab's arranging moved out to panelarrange.js, loaded when Arrange is pressed, no comments cut, no raise (11-10); an agent's own telemetry off in its settings (OipsAnthony on X), in app.js, paid for by sixteen Agents-page comments cut, 1,532,840 after, no raise (11-10); the provider editor's URL taking the /v1 a test found it was typed without (Cyrus_4433 on X), in app.js, paid for by five provider-test comments cut, 1,533,689 after, no raise (11-10); 1,528,998 with the Agents page's Manage agents dialog moved out to agentsmanager.js, loaded when Manage is pressed (11-10); 1,529,335 with an agent's own Provider in model names in agentsuffix.js, loaded when its Details open, and the line that loads it (KillTry27355 on X), no raise (11-10); a Remote magpie's models named by the provider serving them there (lcc580 on X), in app.js, paid for by four comments cut, 1,533,535 after, no raise (11-10) ) func TestCoreScriptBudget(t *testing.T) { diff --git a/internal/gui/providers.go b/internal/gui/providers.go index 177ac0f14..800334979 100644 --- a/internal/gui/providers.go +++ b/internal/gui/providers.go @@ -36,6 +36,7 @@ type modelJSON struct { Name string `json:"name"` // the user's name for it, if they gave one Default string `json:"default,omitempty"` // its own name, when the user gave it another Plain string `json:"plain,omitempty"` // a remote magpie's model's name there alone, when Name has its provider there after it (catalog.Model's) + By string `json:"by,omitempty"` // a remote magpie's model's provider there, the first in a chain (catalog.Model's) Kept []string `json:"kept,omitempty"` // the reasoning levels the user keeps of Efforts, when not all Efforts []string `json:"efforts,omitempty"` Given bool `json:"given,omitempty"` // its levels aren't known: Efforts are those it can be given, Kept those it was @@ -159,6 +160,9 @@ type providerJSON struct { // asked as usual after a quota refusal or a 429, never set aside for // it (provider.LimitRestOff) LimitRestOff bool `json:"limitRestOff"` + // a Remote magpie's models named by the provider serving each there + // (provider.UpstreamProviders, lcc580 on X) + UpstreamProviders bool `json:"upstreamProviders,omitempty"` // DeepSeek's own API sent an agent's images inline on every turn, not // once by file id (provider.ImageFilesOff, #5407); TakesImageFiles: // it is DeepSeek's own API, so the editor offers it @@ -824,7 +828,7 @@ func providerInfoWith(p provider.Provider, ls provider.Listing, agents []agentUs ID: p.ID, Name: p.Name, Icon: p.Icon, IconFrom: p.IconFrom, Preset: p.Preset, Host: p.Host(), Chat: p.Chat, Responses: p.Responses, Anthropic: p.Anthropic, Gemini: p.Gemini, Decide: p.Decide, BaseAPI: p.BaseAPI, ModelTest: p.ModelTest(), TestsAs: p.TestClients(), DecideTest: p.AsksDecideModels(), MarksKinds: p.MarksKinds(), Catalog: p.Catalog, Website: p.Website, KeysURL: p.KeysURL, - Proxy: p.Proxy, AccountProxies: p.AccountProxies, AccountModels: p.AccountModels, AccountCaps: p.AccountCaps, AccountWindowCaps: p.AccountWindowCaps, AccountWindowAmounts: p.AccountWindowAmounts, AccountNames: p.AccountNames, Headers: p.Headers, ExtraBody: p.ExtraBody, ReplyHeaders: p.ReplyHeaders, PassHeaders: p.PassHeaders, Searches: p.Searches, Cline: p.ClinePinnable(), PinUpstream: p.PinUpstream, Unredacted: p.Unredacted, CountFree: p.CountFree, Billing: p.Billing, BillingKind: p.BillingKind(), InsecureTLS: p.InsecureTLS, TakesInsecureTLS: p.TakesInsecureTLS(), HTTP1: p.HTTP1, ClientCert: tilde(p.ClientCert), ClientKey: tilde(p.ClientKey), ServerCA: tilde(p.ServerCA), TakesClientCert: p.TakesClientCert(), Socket: p.Socket, TakesSocket: p.TakesSocket(), LimitRestOff: p.LimitRestOff, ImageFilesOff: p.ImageFilesOff, TakesImageFiles: p.TakesImageFiles(), NativeCompaction: p.NativeCompaction, CarriesCompaction: p.CarriesCompaction(), PassUserAgent: !p.MagpieUserAgent, OwnClient: p.OwnClient(), PassErrors: p.PassErrors, TakesPassErrors: p.TakesPassErrors(), AuthHeader: p.AuthHeader, BothAuth: p.BothAuth(), BalanceURL: p.BalanceURL, BalancePath: p.BalancePath, BalanceMethod: p.BalanceMethod, ModelsURL: p.ModelsURL, ListOff: p.ListsOff(), TakesListOff: p.Account == nil && !p.IsPlugin() && !p.DecideOnly(), TakesModelHeaders: p.Account == nil, DecideAPIKind: p.DecideAPIKind(), + Proxy: p.Proxy, AccountProxies: p.AccountProxies, AccountModels: p.AccountModels, AccountCaps: p.AccountCaps, AccountWindowCaps: p.AccountWindowCaps, AccountWindowAmounts: p.AccountWindowAmounts, AccountNames: p.AccountNames, Headers: p.Headers, ExtraBody: p.ExtraBody, ReplyHeaders: p.ReplyHeaders, PassHeaders: p.PassHeaders, Searches: p.Searches, Cline: p.ClinePinnable(), PinUpstream: p.PinUpstream, Unredacted: p.Unredacted, CountFree: p.CountFree, Billing: p.Billing, BillingKind: p.BillingKind(), InsecureTLS: p.InsecureTLS, TakesInsecureTLS: p.TakesInsecureTLS(), HTTP1: p.HTTP1, ClientCert: tilde(p.ClientCert), ClientKey: tilde(p.ClientKey), ServerCA: tilde(p.ServerCA), TakesClientCert: p.TakesClientCert(), Socket: p.Socket, TakesSocket: p.TakesSocket(), LimitRestOff: p.LimitRestOff, UpstreamProviders: p.UpstreamProviders, ImageFilesOff: p.ImageFilesOff, TakesImageFiles: p.TakesImageFiles(), NativeCompaction: p.NativeCompaction, CarriesCompaction: p.CarriesCompaction(), PassUserAgent: !p.MagpieUserAgent, OwnClient: p.OwnClient(), PassErrors: p.PassErrors, TakesPassErrors: p.TakesPassErrors(), AuthHeader: p.AuthHeader, BothAuth: p.BothAuth(), BalanceURL: p.BalanceURL, BalancePath: p.BalancePath, BalanceMethod: p.BalanceMethod, ModelsURL: p.ModelsURL, ListOff: p.ListsOff(), TakesListOff: p.Account == nil && !p.IsPlugin() && !p.DecideOnly(), TakesModelHeaders: p.Account == nil, DecideAPIKind: p.DecideAPIKind(), Ready: p.Ready(), Chosen: p.PicksOf(avail), Agents: make([]providerAgent, 0, len(agents)), Fallback: p.Fallback, Routing: p.Routing, Sink: p.Sink, UseFirst: p.UseFirst, Affinity: p.Affinity, KeepLogin: p.KeepLogin, KeepLoginAs: p.KeepLoginAs, SwitchOnly: p.SwitchOnly, RestartApp: p.RestartApp, Self: p.SelfAnswered(), KeepSelf: p.KeepSelf, CapStop: p.CapStop, CapCareful: p.CapCareful, Unlisted: p.Unlisted, NoModels: p.ServesNone(), BestInFamily: p.BestInFamily && len(p.Models) == 0 && !p.NoModels, Off: p.Off, Contexts: p.Contexts, MaxConcurrency: p.MaxConcurrency, PluginConcurrency: p.PluginConcurrency(), MaxAccounts: p.MaxAccounts, PluginAccounts: p.PluginAtOnce(), PriceRate: p.PriceRate, @@ -1046,6 +1050,9 @@ func providerInfoWith(p provider.Provider, ls provider.Listing, agents []agentUs } else { j.Plain = m.Plain } + if p.IsRemoteMagpie() { + j.By = m.By + } if api, ok := p.ModelAPI(m.ID); ok { j.API = string(api) } @@ -1622,6 +1629,9 @@ func providerRoutes(mux *http.ServeMux, w Windows) { // LimitRestOff is whether a quota refusal or a 429 leaves it // asked as usual; a save that leaves it out keeps it LimitRestOff *bool `json:"limitRestOff"` + // UpstreamProviders, on a Remote magpie, names its models by the + // provider serving each there; a save that leaves it out keeps it + UpstreamProviders *bool `json:"upstreamProviders"` // ImageFilesOff is whether DeepSeek's own API is sent an // agent's images inline (#5407); a save that leaves it out // keeps it, as `magpie provider set image-files=off` set it @@ -2061,6 +2071,9 @@ func providerRoutes(mux *http.ServeMux, w Windows) { if req.LimitRestOff != nil { in.LimitRestOff = *req.LimitRestOff } + if req.UpstreamProviders != nil { + in.UpstreamProviders = *req.UpstreamProviders && in.IsRemoteMagpie() + } if req.ImageFilesOff != nil { in.ImageFilesOff = *req.ImageFilesOff } @@ -2115,6 +2128,11 @@ func providerRoutes(mux *http.ServeMux, w Windows) { } else if old != nil { in.LimitRestOff = old.LimitRestOff } + if req.UpstreamProviders != nil { + in.UpstreamProviders = *req.UpstreamProviders && in.IsRemoteMagpie() + } else if old != nil { + in.UpstreamProviders = old.UpstreamProviders + } // DeepSeek's images sent inline, set here or with `magpie // provider set image-files=off` (#5407) if req.ImageFilesOff != nil { diff --git a/internal/gui/tests/name-suffix-remote.test.cjs b/internal/gui/tests/name-suffix-remote.test.cjs index 325759e6c..23b419309 100644 --- a/internal/gui/tests/name-suffix-remote.test.cjs +++ b/internal/gui/tests/name-suffix-remote.test.cjs @@ -13,11 +13,11 @@ const { chromium, webkit } = require("playwright"); const assets = path.resolve(__dirname, "../assets"); -function serve(lang, posts, plainNames) { +function serve(lang, posts, plainNames, saves = []) { let cur = { lang, theme: "light", plainNames, plainOwnNames: false }; const state = { agents: [{ id: "codex", name: "Codex", path: "/test/codex", fields: [] }], profiles: [], settings: { lang, theme: "light", plainNames } }; const models = [ - { id: "relaya/deepseek-chat", name: "DeepSeek Chat · Relay A", plain: "DeepSeek Chat", on: true, efforts: [], images: false }, + { id: "relaya/deepseek-chat", name: "DeepSeek Chat · Relay A", plain: "DeepSeek Chat", by: "Relay A", on: true, efforts: [], images: false }, ]; const provider = { id: "remote-magpie", name: "Remote magpie", preset: "remote-magpie", icon: "generic", chat: "http://192.168.1.20:3425/v1", responses: "http://192.168.1.20:3425/v1", anthropic: "http://192.168.1.20:3425", models, agents: [], key: { set: true, masked: "sk-…1234" }, ready: true }; @@ -34,6 +34,7 @@ function serve(lang, posts, plainNames) { return json(cur); } if (url.pathname === "/api/settings") return json(cur); + if (url.pathname === "/api/provider/save") { saves.push(req.postDataJSON()); return json({ id: provider.id }); } if (url.pathname === "/api/plugins") return json({ plugins: [] }); if (url.pathname === "/api/gateway/trace") { if (url.searchParams.get("wait")) return new Promise(() => {}); @@ -83,3 +84,49 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", }); } } + +// lcc580 on X: a Remote magpie's models named by the provider serving each +// there, so one model from two of its providers is told apart here. Its +// editor's switch says what the agents' lists show, under On and Off +// alike, and is saved with the provider. +for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) { + for (const lang of ["en", "zh", "zh-TW", "ja", "de"]) { + test(`${engine} ${lang}: a remote magpie's model named by its provider there`, async (t) => { + const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: process.env.PLAYWRIGHT_CHANNEL || "chromium" })); + t.after(() => browser.close()); + const page = await (await browser.newContext({ viewport: { width: 420, height: 900 }, reducedMotion: "reduce" })).newPage(); + page.setDefaultTimeout(5000); + page.setDefaultNavigationTimeout(60000); + const errors = [], posts = []; + page.on("pageerror", (e) => errors.push(e.message)); + // one route, its server swapped: WebKit lost a route set again after + // the save, and the page's address went to DNS + let served; + await page.route("**/*", (r) => served(r)); + for (const plain of [false, true]) { + const saves = []; + served = serve(lang, posts, plain, saves); + await page.goto("http://magpie.test/?view=providers"); + const tr = (k, vars = {}) => page.evaluate(([k, vars]) => t(k, vars), [k, vars]); + await page.locator(".row.provider").click(); + if (!(await page.locator(".mnames:not([hidden])").count())) await page.getByRole("button", { name: await tr("Model settings"), exact: true }).click(); + const sfx = page.locator(".mnames:not([hidden]) .msuffix"); + await sfx.waitFor(); + const tick = page.locator("label.upstream-providers"); + assert.equal((await tick.textContent()).trim(), await tr("With the provider serving it there")); + assert.equal(await tick.locator("input").isChecked(), false); + await tick.locator("input").check(); + await says(sfx.locator(".hint"), await tr("Agents’ lists show “{label}”", { label: "DeepSeek Chat · Remote magpie › Relay A" })); + await tick.locator("input").uncheck(); + await says(sfx.locator(".hint"), await tr("Agents’ lists show “{label}”", { label: plain ? "DeepSeek Chat" : "DeepSeek Chat · Relay A · Remote magpie" })); + await tick.locator("input").check(); + const ed = page.locator(".editor").filter({ has: tick }); + await Promise.all([page.waitForResponse((r) => r.url().endsWith("/api/provider/save")), ed.locator(".bar button.primary").first().click()]); + assert.equal(saves.length, 1); + assert.equal(saves[0].upstreamProviders, true); + } + assert.deepEqual(posts, []); + assert.deepEqual(errors, []); + }); + } +} diff --git a/internal/provider/modelprefs.go b/internal/provider/modelprefs.go index 79a202852..37d49e938 100644 --- a/internal/provider/modelprefs.go +++ b/internal/provider/modelprefs.go @@ -839,15 +839,48 @@ func renameModelPrefs(s *settings.Settings, from, to string) bool { // when they gave one, else the vendor's) with its provider's after it, or // "routing group" for a group's — dropped only when a name of the user's // own already carries the provider's, so it isn't said twice. +// +// A Remote magpie's model, with its upstream names on (UpstreamProviders), is +// named by its name there alone and the provider serving it there after +// this one's: "Claude Sonnet 5 · Office › RelayA" (lcc580 on X). func (e Entry) Label() string { - by := e.Provider.Name + by, name := e.Provider.Name, e.Name if e.Group != "" { by = "routing group" + } else if up := e.upstream(); up != "" { + by = e.Provider.Name + " › " + up + if e.Default == "" { + name = e.PlainName() + } } - if e.Default != "" && strings.Contains(strings.ToLower(e.Name), strings.ToLower(by)) { - return e.Name + if e.Default != "" && strings.Contains(strings.ToLower(name), strings.ToLower(by)) { + return name } - return e.Name + " · " + by + return name + " · " + by +} + +// upstream is the provider a Remote magpie's model is served by there, +// when its upstream names are on and that magpie's list said which; "" +// otherwise (a magpie from before magpie_by says none). +func (e Entry) upstream() string { + if e.Group != "" || !e.Provider.UpstreamProviders || !e.Provider.IsRemoteMagpie() { + return "" + } + return e.By +} + +// ServedBy is the provider this magpie's list tells another magpie serves +// the entry (magpie_by): its own provider, or, for a model it has from a +// magpie further on, the one there, the first in the chain; "routing +// group" for a group's. +func (e Entry) ServedBy() string { + switch { + case e.Group != "": + return "routing group" + case e.Provider.IsRemoteMagpie() && e.By != "": + return e.By + } + return e.Provider.Name } // Labels are how an agent's list names each of es, in order: as Label, or, @@ -893,6 +926,11 @@ func LabelsFor(agent string, es []Entry) []string { if !(plain || mine) || name == "" { continue } + // a Remote magpie's model named by its provider there keeps it + // under Off too: the user turned that on for this one (lcc580) + if e.upstream() != "" && !mine { + continue + } k := strings.ToLower(name) if e.Group == "" && models[k] == 1 || e.Group != "" && models[k] == 0 && groups[k] == 1 { out[i] = name @@ -1472,7 +1510,7 @@ func wireKey(wires map[string]string, pid, model string) string { return key } -// UpstreamNames are the names the user gave the provider's models, by model +// UpstreamProviders are the names the user gave the provider's models, by model // id, with the one given for all of them under "*" — each as it will be sent, // trimmed, "*" and all, which is what a list of them shows. A name that is // only whitespace is none, and is not listed. diff --git a/internal/provider/models.go b/internal/provider/models.go index 980c3e1bd..17fc2d818 100644 --- a/internal/provider/models.go +++ b/internal/provider/models.go @@ -3129,7 +3129,10 @@ type Entry struct { Default string `json:"default,omitempty"` // the model's own name, when the user gave it another // Plain is a remote magpie's model's name there alone, when Name is // its label there with that magpie's provider after it (catalog.Model's) - Plain string `json:"-"` + Plain string `json:"-"` + // By is the provider a remote magpie's list names as serving the + // model there, the first in a chain of magpies (catalog.Model's) + By string `json:"-"` Efforts []string `json:"efforts,omitempty"` Provider Provider `json:"-"` // a group's: its first member's Group string `json:"group,omitempty"` // set on a routing group (group.go) @@ -3477,6 +3480,9 @@ func entryFor(p Provider, m catalog.Model, s settings.Settings) Entry { } else { e.Plain = m.Plain } + if p.IsRemoteMagpie() { + e.By = m.By + } // a model that thinks still does with the levels the user kept or // none at all; one its source says nothing of thinks as most of the // providers serving it say (#402) diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 1acb75f97..e6e994ad7 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -339,6 +339,15 @@ type Provider struct { // by its file id (gateway's deepseek_files.go, #5407). ImageFilesOff bool `json:"imageFilesOff,omitempty"` + // UpstreamProviders, on a Remote magpie, `upstream-providers=on`, names each + // of its models in the agents' lists by the provider serving it on + // the other magpie, the first in a chain of them: "Claude Sonnet 5 · + // Office › RelayA", whatever that magpie's own Provider in model names + // is, so one model from two of its providers is told apart here + // (lcc580 on X). Off, the default, names each as that magpie's list + // does. The ids stay as they are: office/relaya/claude-sonnet-5. + UpstreamProviders bool `json:"upstreamProviders,omitempty"` + // PromptAsWritten, on Antigravity's subscription, has the system prompt // go to Google exactly as the agent wrote it. By default the few lines // Google answers with a 429 "Resource has been exhausted" whatever diff --git a/internal/provider/upstream_names_test.go b/internal/provider/upstream_names_test.go new file mode 100644 index 000000000..bb1eedab4 --- /dev/null +++ b/internal/provider/upstream_names_test.go @@ -0,0 +1,32 @@ +package provider + +import "testing" + +// A magpie's list tells another the provider serving each model +// (magpie_by): its own provider, the one at the start of a chain of +// magpies for a Remote magpie's, "routing group" for a group (lcc580 on +// X). A Remote magpie whose list said none (one from before) is named +// as ever, upstream names on or off. +func TestServedByAndUpstreamLabel(t *testing.T) { + relay := Provider{ID: "relaya", Name: "Relay A"} + remote := Provider{ID: "office", Name: "Office", Preset: RemoteMagpiePreset, UpstreamProviders: true} + for _, c := range []struct { + e Entry + by, label string + }{ + {Entry{Name: "DeepSeek Chat", Provider: relay}, "Relay A", "DeepSeek Chat · Relay A"}, + {Entry{Name: "Fast", Group: "fast", Provider: relay}, "routing group", "Fast · routing group"}, + {Entry{Name: "DeepSeek Chat · Relay A", Plain: "DeepSeek Chat", By: "Relay A", Provider: remote}, "Relay A", "DeepSeek Chat · Office › Relay A"}, + {Entry{Name: "Mine", Default: "DeepSeek Chat", By: "Relay A", Provider: remote}, "Relay A", "Mine · Office › Relay A"}, + {Entry{Name: "DeepSeek Chat · Relay A", Plain: "DeepSeek Chat", Provider: remote}, "Office", "DeepSeek Chat · Relay A · Office"}, + // upstream names on a provider that isn't a Remote magpie do nothing + {Entry{Name: "DeepSeek Chat", By: "Relay A", Provider: Provider{ID: "x", Name: "X", UpstreamProviders: true}}, "X", "DeepSeek Chat · X"}, + } { + if got := c.e.ServedBy(); got != c.by { + t.Errorf("%+v: served by %q, want %q", c.e, got, c.by) + } + if got := c.e.Label(); got != c.label { + t.Errorf("%+v: label %q, want %q", c.e, got, c.label) + } + } +}