diff --git a/docs/subsystems/agent-wiring.md b/docs/subsystems/agent-wiring.md index 6fb3fa3f6..716b94058 100644 --- a/docs/subsystems/agent-wiring.md +++ b/docs/subsystems/agent-wiring.md @@ -50,7 +50,7 @@ something else shows up as drift. - An agent whose `Sync` does nothing but bring a block of magpie's name up to the catalog is `ListOnly` (OpenCode, MiMo Code and the other OpenCode forms, Pi and its forks, Goose, Crush, Air, AtomCode, Command Code, Droid, Fx, jcode, Kimi, MiniMax, Mothx, omp, OpenChamber, OpenClaw, OpenPencil, Penguin, Qwen Code, T3 Code). `SyncCatalog` runs it only while the agent is connected (`Wired`), as its switch on the Agents page says: a custom provider the user named magpie in the agent, with a few models picked by hand, was written over with the whole catalog at every start (yyddbds on Discord, Xiaomi MiMo; `TestCatalogSyncLeavesAHandWrittenMagpieBlock`). A list magpie wrote while connected waits, while the agent runs a model of its own, until a model of magpie's is picked again; a model of magpie's picked by hand on a provider the user wrote doesn't connect it (`handWired`, above). Every `ListOnly` agent magpie connects reads as `Wired` (`TestListOnlyAgentsReadConnected`). Agents whose `Sync` also repairs while not connected (Codex, Claude, Grok, Hermes' bots) are not `ListOnly`. magpie keeps no copy of a list it wrote over before this, so such a list stays full until the user trims it. - `SyncCatalog` holds the catalog it builds (`provider.Hold`), the plugins' providers and sign-ins among it, for up to a second. Those `catalog.Touched` drops are told in the background, so a plugin change also drops what is held at once (`plugin.OnChangeNow`, [`hold.go`](../../internal/provider/hold.go)): the host's "auth" event is read before its reply to the sign-in that saved it, and a look at the accounts once the sign-in returns sees it (#2449: `magpie plugin login` found no account while a sync ran; `TestHeldGoesWithAPluginChange`). - JetBrains Air's `magpie-opencode.json` keeps user-added fields in `provider.magpie`, including nested options, on sync and model picks (`air` in [`air.go`](../../internal/agent/air.go), using `theirsKept` in [`sync.go`](../../internal/agent/sync.go)). The gateway fields and complete model list are still replaced, so removed models leave the list. -- Air comes in two forms that read different files, both wired by `airAt` in [`air.go`](../../internal/agent/air.go). The Air app (`air`) reads `acp.json` in its own config folder. The Air plugin in JetBrains IDEs (`air-ide`; bundled from 2026.3, from Marketplace in 2026.2) reads `~/.jetbrains/acp.json` on every system, the file AI Assistant's custom agents are in too (`AcpConfigurationLoader` in the plugin's `intellij.air.backend.acp.runtime`, checked in air-plugin 262.8665.521). Each gets its own Magpie entry and `magpie-opencode.json` beside its `acp.json`. `air-ide` shows for an IDE config folder of 2026.2 or later, or with its entry already there (`TestAirIDEDetectedByIDEVersion`). Neither has a base URL for its own agents (JetBrains AI, the agent's login, or an Anthropic, OpenAI, Gemini or OpenRouter key); JetBrains says an installed agent runs on its existing configuration, so a Codex on its own login would read `~/.codex`, which the Codex agent wires (not tried in an IDE). +- Air comes in two forms that read different files, both wired by `airAt` in [`air.go`](../../internal/agent/air.go). The Air app (`air`) reads `acp.json` in its own config folder. The Air plugin in JetBrains IDEs (`air-ide`; bundled from 2026.3, from Marketplace in 2026.2) reads `~/.jetbrains/acp.json` on every system, the file AI Assistant's custom agents are in too (`AcpConfigurationLoader` in the plugin's `intellij.air.backend.acp.runtime`, checked in air-plugin 262.8665.521). Each gets its own Magpie entry and `magpie-opencode.json` beside its `acp.json`. `air-ide` shows for an IDE config folder of 2026.2 or later, or with its entry already there (`TestAirIDEDetectedByIDEVersion`). Neither has a base URL for its own agents (JetBrains AI, the agent's login, or an Anthropic, OpenAI, Gemini or OpenRouter key); The plugin's Codex on its own login runs this computer's `codex` (the terminal's `PATH`, else the `@openai/codex` it installs) as `codex app-server` with the user's `CODEX_HOME` or `~/.codex`, and sets no `model_provider` (`CodexAppServerProcessKt`); its menu is Codex's `model/list` and its default `config/read`'s model. Its Claude Agent runs `claude` with only Air's hooks in `--settings`. So both go through magpie while Codex and Claude Code are connected here. The Air app's Codex runs with a `CODEX_HOME` of its own and JetBrains' gateway (`codexRuntimeEnvironment`, `[model_providers.air-gateway]`), and never does. The model on either Air row is the Magpie agent's alone, and the opened row says which of Air's own agents go through magpie (`airSaid` in `app.js`, `agent-air-own.test.cjs`; jumy_18634 on Discord). - In every OpenCode-shaped config (OpenCode, DevEco, Air, OpenChamber; `openCodeKept` in [`agents.go`](../../internal/agent/agents.go)), a variant the user put on one of magpie's models stays through a sync, and so does one they wrote over under a name of magpie's. A variant exactly as magpie writes it under its name (`openCodeVariant`) is magpie's, so one the model no longer has goes (#2379, `TestOpenCodeCodexFastVariants`). - magpie's OpenCode provider goes under `provider` (OpenCode 1's key), not OpenCode 2's native `providers`, on purpose. OpenCode 2 reads `provider` and turns it into its own shape in memory without rewriting the file (`migrateProviders` in packages/core/src/config/normalize.ts at v2.2.0; its "Migrate from V1" page calls the V1 format supported and converting optional), while OpenCode 1 ignores `providers` (`ConfigV2Compat.lower` in packages/opencode/src/config/v2-compat.ts at v1.19.5, npm's `latest`), and both read the same opencode.json. A native entry is a different shape too (`package`, `settings.baseURL`, variants as an array). Checked on 10-29 against a fake server: 2.2.0 listed and used magpie's `provider` entry (`#high-fast` sent reasoning_effort high and service_tier priority), and 1.19.5 with the entry under `providers` had no magpie models. OpenCode 2 logs one WARN for each model marked `reasoning`, which only OpenCode 1 reads. - OpenCode has no `/fast`. A ChatGPT account's own `gpt-*` model, not a routing group (`catalog.Model.CodexFast`, set in `magpieModels`), gets each reasoning level again as `-fast` (or `fast` alone with no levels), asking `service_tier: "priority"` as Codex's `/fast` does. The tier is written twice: as an option, which OpenCode 1's `@ai-sdk/openai-compatible` sends as it is, and in `extraBody`, which OpenCode 2 sends while it drops an option it doesn't know (checked with OpenCode 2.0.25 against a fake server). The gateway drops OpenCode 1's stray `extraBody` field when it rebuilds the request as Responses for the ChatGPT backend (`TestOpenCodeFastVariantReachesCodex`). diff --git a/internal/agent/air.go b/internal/agent/air.go index a08411a82..a30ea8b72 100644 --- a/internal/agent/air.go +++ b/internal/agent/air.go @@ -156,11 +156,17 @@ func air(home, cfg string) *Agent { // config folder. An entry takes command, args, env, use_idea_mcp and // use_custom_mcp. Its own agents (Claude Agent, Codex, Junie, …) run on // JetBrains AI, the agent's own login, or an Anthropic, OpenAI, Gemini or -// OpenRouter key under AI › Air › Accounts, none with a base URL (an -// installed agent on its own login runs on its existing configuration, as -// JetBrains' docs say, so a Codex there would read the ~/.codex magpie's -// Codex wires; not tried in an IDE). So magpie adds the same Magpie agent -// as the app's, with its OpenCode config beside acp.json. +// OpenRouter key under AI › Air › Accounts, none with a base URL. On its +// own login its Codex runs this computer's codex (the terminal's PATH, else +// the @openai/codex it installs) as `codex app-server`, with the user's +// CODEX_HOME or ~/.codex and no model_provider or CODEX_HOME of its own +// (CodexAppServerProcessKt, CodexCliUtils), its model menu Codex's +// model/list and its default config/read's model; its Claude Agent runs +// claude with only Air's hooks in --settings. So both are on magpie while +// Codex and Claude Code are connected here, and the model picked on Air's +// row is the Magpie agent's alone (jumy_18634 on Discord), which the row +// says (airSaid in app.js). magpie adds the same Magpie agent as the +// app's, with its OpenCode config beside acp.json. func airIDE(home, cfg string) *Agent { dir := filepath.Join(home, ".jetbrains") path := filepath.Join(dir, "acp.json") diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.js index a11358adb..7eced7774 100644 --- a/internal/gui/assets/app.js +++ b/internal/gui/assets/app.js @@ -1120,11 +1120,7 @@ const REAPPLY = "M13.5 8a5.5 5.5 0 1 1-1.6-3.9M13.5 2.5v3.25h-3.25"; const UNPLUG = "M6 2v3M10 2v3M4.5 5h7v2.5a3.5 3.5 0 0 1-7 0zM8 11v3M2 2l12 12"; const DISCONNECT_TIP = "Take out everything magpie wrote into {agent}'s config and put back what it had before"; -// An agent is connected to magpie with a switch (the owner: the Agents page -// connects an agent, and its models are picked in the agent): on, magpie is -// its provider and its own model list has magpie's models (agent.Connect); -// off, magpie takes out what it wrote (askDisconnect). An agent with none of -// magpie's models to offer (Cursor, Copilot) has no switch. +// an agent is connected with a switch (agent.Connect), off takes out what magpie wrote // the field magpie is picked in: the first, or Gemini CLI's model, its // first being how it signs in const connectField = (a) => a.fields.find((f) => f.options.some((o) => o.ref)) || a.fields.find((f) => f.options.some((o) => o.value === "magpie")); @@ -1213,13 +1209,7 @@ function connectSwitch(a) { return s; } -// ---------- 「接入」 in the window (the owner's design boards) ---------- -// A row there answers one thing: does the agent go through magpie. Its -// switch stands where the model and effort pickers stood, a line under the -// name says what it runs on and where it picks a model, and a connected -// one opens to what else there is: when it takes effect, which models it -// lists, what a new session starts on, the files magpie changed, and the -// way back. +// ---------- 「接入」 in the window: does the agent go through magpie ---------- // agents with no way onto magpie: no switch, the reason instead, and that // it is why (@G_Z_Y on X read "Only Cursor's own models" beside "Can't @@ -1243,12 +1233,7 @@ const MENU_FROM_LIST = new Set(["claude-desktop", "cursor-local"]); const listsMenu = (a) => MENU_FROM_LIST.has(a.id) || !!a.menu; const menuFromList = (a) => listsMenu(a) && a.wired && !!a.models; -// menuSaid: the models such an agent lists, as its list's ticks are. Every -// one ticked is said as all of them, a few picked by their names, and more -// as how many of how many. Its first two names and +N (routing groups come -// first) read as a pick of a group and a model while every model was on -// (NG_shiyu on X: 「路由组,模型+数字」 here, one 「路由」 on the row above, -// and every model in the list opened) +// menuSaid: the models such an agent lists, as its list's ticks are (NG_shiyu on X) function menuSaid(c) { if (!c.shown) return t("No models"); if (c.shown >= c.listed) return t("All {n} models", { n: c.listed }); @@ -1500,24 +1485,12 @@ function sheet(box, open, done) { run.oncancel = run.onfinish; } -// startField: the field an agent's model is picked in (Gemini CLI's model, -// not how it signs in). Its model is that field whatever the providers -// on: one switched off changes only what it lists, so Codex's model with -// none of magpie's left isn't traded for its subagent model, which still -// has a ChatGPT account's (#1582). A model with nothing to list (Ante's, -// magpie's only) leaves the field it connects through. +// startField: the field an agent's model is picked in (#1582) function startField(a) { return a.fields.find((f) => f.key === "model" && f.options.length) || connectField(a); } -// startButton picks the model an agent starts on, from the row. It says -// what the agent is on, connected or not, its Default or a model, and -// lists every choice: the agent's own models with magpie's. A magpie model -// picked while it isn't connected connects it and starts it on it. Not -// connected, only Claude Code said its model, the others Pick a model -// beside it (EZN7L2C3, #834: 这里似乎需要统一); and Claude Code's list had -// lost the one picked. A field that isn't a model (a provider) still -// offers magpie's models alone. +// startButton picks the model an agent starts on, from the row (#834) function startButton(a, f, fieldBtn) { const b = fieldBtn(f, "ag-start"); if (!a.wired && !a.native && f.key !== "model" && !f.options.some((o) => o.direct)) { @@ -1720,15 +1693,7 @@ function agentsLead(list) { } } -// ---------- Get started (wangye1644294 on X) ---------- -// A new user is shown three steps above the agents: add a model source, -// connect an agent (those magpie found here listed, each connected in a -// click), and, optionally, a routing group made of their own models in a -// click (provider.Templates). Each step is ticked from what is so — the -// models magpie serves (state.served), an agent wired, a group of the -// user's own — never from having been seen. The card goes once the first -// two are done, or when put away (settings.GuideHidden, saved on the -// server so the panel and the window agree). +// ---------- Get started (wangye1644294 on X): three steps, each ticked from what is so ---------- // the templates offered as a starter, most harmless first: each behind // the other changes no model the agent asked for until one fails @@ -2089,6 +2054,19 @@ function appRestart(a) { return go; } +// Air's own Codex and Claude Agent: the IDE plugin's run this computer's codex and claude, the app's never go through magpie (jumy_18634) +const AIR_KINDS = new Set(["air", "air-ide"]); +function airSaid(a, line) { + const warn = (s) => { const w = line(el("span", "ag-dot"), el("span", "", s)); w.classList.add("ag-warn", "ag-air-own"); return w; }; + const out = [line(t("In Air's agent menu, pick Magpie: the model here is Magpie's, and magpie's models are in its model menu."))]; + if (kindOf(a) === "air") return [...out, warn(t("Air's own agents (Codex, Claude Agent…) run on Air's own sign-in and settings, not through magpie: only Magpie in its agent menu takes magpie's models."))]; + out.push(line(t("Air's own Codex and Claude Agent don't take the model here: they run the Codex and Claude Code on this computer, with those agents' own settings."))); + const on = (id) => state.agents.find((x) => x.id === id + a.id.slice(7))?.wired; + out.push(on("codex") ? line(t("Codex is connected here, so Air's Codex lists magpie's models too: pick one in its model menu, in a new Codex task.")) : warn(t("Codex isn't connected here, so Air's Codex doesn't go through magpie: connect Codex here to put magpie's models in its model menu."))); + out.push(on("claude") ? line(t("Claude Code is connected here, so Air's Claude Agent goes through magpie, on the models picked for Claude Code.")) : warn(t("Claude Code isn't connected here, so Air's Claude Agent doesn't go through magpie."))); + return out; +} + // connectPanel: a connected agent's row, opened function connectPanel(a, { fields, fieldBtn }) { const box = el("div", "ag-exp"); @@ -2160,7 +2138,7 @@ function connectPanel(a, { fields, fieldBtn }) { // its 3p window has no Chinese (GZXYMH on X) if (a.id === "claude-desktop" && /^zh/.test(locale)) p.push(el("div", "ag-vl ag-warn ag-desktop-lang")), p[1].append(el("span", "ag-dot"), el("span", "", t("On magpie, Desktop shows Anthropic's gateway window, which has no Chinese; disconnect it for Chinese."))); kv(t("In {agent}", { agent: a.name }), ...p); - } + } else if (AIR_KINDS.has(kindOf(a))) kv(t("In {agent}", { agent: a.name }), ...airSaid(a, line)); // Hermes' other profiles, each on its own model const bots = a.fields.filter(hermesBot); if (bots.length) kv(t("Other profiles"), ...bots.map((f) => line(el("span", "ag-tier", f.label), fieldBtn(f, "ag-pick"), el("span", "ag-hint", "hermes -p " + f.label)))); diff --git a/internal/gui/assets/i18n.js b/internal/gui/assets/i18n.js index 3265bd093..5ac9dbed0 100644 --- a/internal/gui/assets/i18n.js +++ b/internal/gui/assets/i18n.js @@ -690,6 +690,13 @@ const I18N = { "Only each model's largest window": "只显示每个模型的最大上下文", "A model of 1M or more is listed once, as its 1M entry. Quit and reopen Claude Desktop after a change.": "上下文达到 1M 或以上的模型只列一项,即它的 1M 版本。改动后需退出并重新打开 Claude Desktop。", "On magpie, Desktop shows Anthropic's gateway window, which has no Chinese; disconnect it for Chinese.": "接入 magpie 后,Claude Desktop 显示的是 Anthropic 自带的网关模式界面,它没有中文,会显示英文。这是 Claude Desktop 自身缺少的翻译;从 magpie 断开后,Desktop 的中文就会回来。", + "In Air's agent menu, pick Magpie: the model here is Magpie's, and magpie's models are in its model menu.": "在 Air 的 Agent 菜单里选 Magpie:这里选的模型是 Magpie Agent的,magpie 的模型都在它的模型菜单里。", + "Air's own agents (Codex, Claude Agent…) run on Air's own sign-in and settings, not through magpie: only Magpie in its agent menu takes magpie's models.": "Air 自带的 Agent(Codex、Claude Agent 等)用的是 Air 自己的登录和设置,不经过 magpie:只有它 Agent 菜单里的 Magpie 用 magpie 的模型。", + "Air's own Codex and Claude Agent don't take the model here: they run the Codex and Claude Code on this computer, with those agents' own settings.": "Air 自带的 Codex 和 Claude Agent 不用这里选的模型:它们运行的是这台电脑上的 Codex 和 Claude Code,用的是这两个 Agent自己的设置。", + "Codex is connected here, so Air's Codex lists magpie's models too: pick one in its model menu, in a new Codex task.": "Codex 已在这里接入,所以 Air 的 Codex 也会列出 magpie 的模型:新建一个 Codex 任务,在它的模型菜单里选一个。", + "Codex isn't connected here, so Air's Codex doesn't go through magpie: connect Codex here to put magpie's models in its model menu.": "Codex 还没有在这里接入,所以 Air 的 Codex 不经过 magpie:在这里接入 Codex,它的模型菜单里就会有 magpie 的模型。", + "Claude Code is connected here, so Air's Claude Agent goes through magpie, on the models picked for Claude Code.": "Claude Code 已在这里接入,所以 Air 的 Claude Agent 经过 magpie,用的是给 Claude Code 选的模型。", + "Claude Code isn't connected here, so Air's Claude Agent doesn't go through magpie.": "Claude Code 还没有在这里接入,所以 Air 的 Claude Agent 不经过 magpie。", "Saved — quit and reopen Claude Desktop to see it": "已保存——退出并重新打开 Claude Desktop 后生效", "Model list": "模型列表", "only the {n} picked": "仅显示所选的 {n} 个", @@ -5168,6 +5175,13 @@ const I18N = { "Only each model's largest window": "只顯示每個模型的最大上下文", "A model of 1M or more is listed once, as its 1M entry. Quit and reopen Claude Desktop after a change.": "上下文達到 1M 或以上的模型只列一項,即它的 1M 版本。改動後需結束並重新開啟 Claude Desktop。", "On magpie, Desktop shows Anthropic's gateway window, which has no Chinese; disconnect it for Chinese.": "接入 magpie 後,Claude Desktop 顯示的是 Anthropic 內建的閘道模式介面,它沒有中文,會顯示英文。這是 Claude Desktop 本身缺少的翻譯;從 magpie 中斷連線後,Desktop 的中文就會回來。", + "In Air's agent menu, pick Magpie: the model here is Magpie's, and magpie's models are in its model menu.": "在 Air 的 Agent 選單裡選 Magpie:這裡選的模型是 Magpie Agent的,magpie 的模型都在它的模型選單裡。", + "Air's own agents (Codex, Claude Agent…) run on Air's own sign-in and settings, not through magpie: only Magpie in its agent menu takes magpie's models.": "Air 內建的 Agent(Codex、Claude Agent 等)用的是 Air 自己的登入和設定,不經過 magpie:只有它 Agent 選單裡的 Magpie 使用 magpie 的模型。", + "Air's own Codex and Claude Agent don't take the model here: they run the Codex and Claude Code on this computer, with those agents' own settings.": "Air 內建的 Codex 和 Claude Agent 不使用這裡選的模型:它們執行的是這台電腦上的 Codex 和 Claude Code,用的是這兩個 Agent自己的設定。", + "Codex is connected here, so Air's Codex lists magpie's models too: pick one in its model menu, in a new Codex task.": "Codex 已在這裡接入,所以 Air 的 Codex 也會列出 magpie 的模型:新增一個 Codex 任務,在它的模型選單裡選一個。", + "Codex isn't connected here, so Air's Codex doesn't go through magpie: connect Codex here to put magpie's models in its model menu.": "Codex 還沒有在這裡接入,所以 Air 的 Codex 不經過 magpie:在這裡接入 Codex,它的模型選單裡就會有 magpie 的模型。", + "Claude Code is connected here, so Air's Claude Agent goes through magpie, on the models picked for Claude Code.": "Claude Code 已在這裡接入,所以 Air 的 Claude Agent 經過 magpie,用的是為 Claude Code 選的模型。", + "Claude Code isn't connected here, so Air's Claude Agent doesn't go through magpie.": "Claude Code 還沒有在這裡接入,所以 Air 的 Claude Agent 不經過 magpie。", "Saved — quit and reopen Claude Desktop to see it": "已儲存——結束並重新開啟 Claude Desktop 後生效", "Model list": "模型列表", "only the {n} picked": "僅顯示所選的 {n} 個", @@ -9611,6 +9625,13 @@ const I18N = { "Only each model's largest window": "各モデルの最大コンテキストのみ表示", "A model of 1M or more is listed once, as its 1M entry. Quit and reopen Claude Desktop after a change.": "1M 以上のコンテキストを持つモデルは 1M 版の 1 項目だけ表示されます。変更後は Claude Desktop を終了して開き直してください。", "On magpie, Desktop shows Anthropic's gateway window, which has no Chinese; disconnect it for Chinese.": "magpie 経由では、Claude Desktop は Anthropic 独自のゲートウェイ用ウィンドウを表示します。そこには中国語がなく、英語で表示されます。magpie から切断すると Desktop の中国語が戻ります。", + "In Air's agent menu, pick Magpie: the model here is Magpie's, and magpie's models are in its model menu.": "Air のエージェントメニューで Magpie を選んでください。ここで選ぶモデルは Magpie エージェントのもので、magpie のモデルはそのモデルメニューにあります。", + "Air's own agents (Codex, Claude Agent…) run on Air's own sign-in and settings, not through magpie: only Magpie in its agent menu takes magpie's models.": "Air 自身のエージェント(Codex、Claude Agent など)は Air 独自のサインインと設定で動き、magpie を経由しません。magpie のモデルを使うのはエージェントメニューの Magpie だけです。", + "Air's own Codex and Claude Agent don't take the model here: they run the Codex and Claude Code on this computer, with those agents' own settings.": "Air 自身の Codex と Claude Agent はここのモデルを使いません。このコンピューターの Codex と Claude Code を、それぞれ自身の設定で実行します。", + "Codex is connected here, so Air's Codex lists magpie's models too: pick one in its model menu, in a new Codex task.": "Codex はここで接続済みなので、Air の Codex にも magpie のモデルが並びます。新しい Codex タスクのモデルメニューで選んでください。", + "Codex isn't connected here, so Air's Codex doesn't go through magpie: connect Codex here to put magpie's models in its model menu.": "Codex はここで接続されていないため、Air の Codex は magpie を経由しません。ここで Codex を接続すると、そのモデルメニューに magpie のモデルが入ります。", + "Claude Code is connected here, so Air's Claude Agent goes through magpie, on the models picked for Claude Code.": "Claude Code はここで接続済みなので、Air の Claude Agent は magpie を経由し、Claude Code 用に選んだモデルで動きます。", + "Claude Code isn't connected here, so Air's Claude Agent doesn't go through magpie.": "Claude Code はここで接続されていないため、Air の Claude Agent は magpie を経由しません。", "Saved — quit and reopen Claude Desktop to see it": "保存しました。Claude Desktop を終了して開き直すと反映されます", "Model list": "モデル一覧", "only the {n} picked": "選んだ {n} 件のみ", @@ -14072,6 +14093,13 @@ const I18N = { "Only each model's largest window": "Nur das größte Kontextfenster jedes Modells", "A model of 1M or more is listed once, as its 1M entry. Quit and reopen Claude Desktop after a change.": "Ein Modell mit 1M oder mehr erscheint nur einmal, als 1M-Eintrag. Beende Claude Desktop nach einer Änderung und öffne es neu.", "On magpie, Desktop shows Anthropic's gateway window, which has no Chinese; disconnect it for Chinese.": "Über magpie zeigt Claude Desktop Anthropics eigenes Fenster für ein Gateway, das kein Chinesisch hat: Es ist auf Englisch. Desktops Chinesisch kommt zurück, wenn es von magpie getrennt wird.", + "In Air's agent menu, pick Magpie: the model here is Magpie's, and magpie's models are in its model menu.": "Wähle in Airs Agentenmenü Magpie: Das Modell hier ist das des Magpie-Agenten, und magpies Modelle stehen in seinem Modellmenü.", + "Air's own agents (Codex, Claude Agent…) run on Air's own sign-in and settings, not through magpie: only Magpie in its agent menu takes magpie's models.": "Airs eigene Agenten (Codex, Claude Agent …) laufen mit Airs eigener Anmeldung und Einstellungen, nicht über magpie: Nur Magpie in seinem Agentenmenü nimmt magpies Modelle.", + "Air's own Codex and Claude Agent don't take the model here: they run the Codex and Claude Code on this computer, with those agents' own settings.": "Airs eigener Codex und Claude Agent nehmen das Modell hier nicht: Sie starten Codex und Claude Code auf diesem Computer, mit deren eigenen Einstellungen.", + "Codex is connected here, so Air's Codex lists magpie's models too: pick one in its model menu, in a new Codex task.": "Codex ist hier verbunden, also listet Airs Codex auch magpies Modelle: Wähle eines in seinem Modellmenü, in einer neuen Codex-Aufgabe.", + "Codex isn't connected here, so Air's Codex doesn't go through magpie: connect Codex here to put magpie's models in its model menu.": "Codex ist hier nicht verbunden, also läuft Airs Codex nicht über magpie: Verbinde Codex hier, damit magpies Modelle in seinem Modellmenü stehen.", + "Claude Code is connected here, so Air's Claude Agent goes through magpie, on the models picked for Claude Code.": "Claude Code ist hier verbunden, also läuft Airs Claude Agent über magpie, mit den für Claude Code gewählten Modellen.", + "Claude Code isn't connected here, so Air's Claude Agent doesn't go through magpie.": "Claude Code ist hier nicht verbunden, also läuft Airs Claude Agent nicht über magpie.", "Saved — quit and reopen Claude Desktop to see it": "Gespeichert – beende Claude Desktop und öffne es neu, um es zu sehen", "Model list": "Modellliste", "only the {n} picked": "nur die {n} ausgewählten", diff --git a/internal/gui/core_budget_test.go b/internal/gui/core_budget_test.go index fa2a061a4..2731c0495 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) + 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) ) func TestCoreScriptBudget(t *testing.T) { diff --git a/internal/gui/tests/agent-air-own.test.cjs b/internal/gui/tests/agent-air-own.test.cjs new file mode 100644 index 000000000..150992f95 --- /dev/null +++ b/internal/gui/tests/agent-air-own.test.cjs @@ -0,0 +1,100 @@ +// Run with Node's test runner and Playwright on the module path; see README.md. +// JetBrains Air's row picks the model of the Magpie agent magpie adds to +// Air, and nothing else. jumy_18634 on Discord picked one there and found +// Air's own Codex still on its own model. Air's IDE plugin runs the codex +// and claude on this computer, so its Codex and Claude Agent are on magpie +// exactly while Codex and Claude Code are connected here; the Air app's run +// on its own sign-in and never are. Each row, opened, says which, in every +// language, wide and narrow. No backend: faked here. +const assert = require("node:assert/strict"); +const fs = require("node:fs/promises"); +const path = require("node:path"); +const { test } = require("node:test"); +const { chromium, webkit } = require("playwright"); +const { strings } = require("./strings.cjs"); + +const assets = path.resolve(__dirname, "../assets"); +const { I18N } = strings(); +const say = (lang, k) => (lang === "en" ? k : I18N[lang][k]); + +const model = (v) => [{ key: "model", label: "model", value: v, options: [{ value: v, ref: "qoder/qoder-fast", label: "qoder-fast", icon: "magpie" }] }]; +function fixture(lang) { + const settings = { lang, theme: "light" }; + const state = () => ({ + agents: [ + { id: "air-ide", name: "Air (JetBrains IDEs)", path: "/test/.jetbrains/acp.json", icon: "air", wired: true, fields: model("qoder/qoder-fast") }, + { id: "air", name: "JetBrains Air", path: "/test/Air/acp.json", icon: "air", wired: true, fields: model("qoder/qoder-fast") }, + { id: "codex", name: "Codex", path: "/test/.codex/config.toml", icon: "openai", wired: true, fields: model("qoder/qoder-fast") }, + { id: "claude", name: "Claude Code", path: "/test/.claude/settings.json", icon: "claude-color", wired: false, fields: model("") }, + ], + profiles: [], settings, + }); + async function serve(route) { + const req = route.request(), url = new URL(req.url()); + const json = (data) => route.fulfill({ json: data }); + if (url.pathname === "/boot.js") return route.fulfill({ contentType: "text/javascript", body: `window.bootPrefs = {lang:"${lang}",theme:"light",web:true};` }); + if (url.pathname === "/wails/runtime.js") return route.fulfill({ contentType: "text/javascript", body: "export const Window = {};" }); + if (url.pathname === "/api/state") return json(state()); + if (url.pathname === "/api/usage/quotas") return json([]); + if (url.pathname === "/api/groups") return json({ groups: [] }); + if (url.pathname === "/api/agents/cli") return json({ agents: {}, pending: false }); + if (url.pathname === "/api/providers") return json({ providers: [], gateway: { running: true } }); + if (url.pathname === "/api/plugins") return json({ plugins: [] }); + if (url.pathname.startsWith("/api/")) return json({}); + const file = path.join(assets, url.pathname === "/" ? "index.html" : url.pathname); + const contentType = { ".html": "text/html", ".js": "text/javascript", ".css": "text/css", ".svg": "image/svg+xml", ".png": "image/png" }[path.extname(file)]; + await route.fulfill({ body: await fs.readFile(file), contentType }); + } + return { serve }; +} + +const DETAILS = { en: "Details", zh: "详情", "zh-TW": "詳情", ja: "詳細", de: "Details" }; +const row = (id) => `.row.agent[data-id="${id}"]`; +const text = async (loc) => (await loc.allTextContents()).map((s) => s.trim()); + +for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) { + for (const lang of Object.keys(DETAILS)) { + for (const width of [1100, 640]) { + test(`${engine} ${lang} ${width}px: Air's rows say whether Air's own Codex and Claude Agent go through magpie`, async (t) => { + const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" })); + const page = await browser.newPage({ viewport: { width, height: 900 } }); + page.setDefaultTimeout(5000); + page.setDefaultNavigationTimeout(60000); + const errors = []; + page.on("pageerror", (e) => errors.push(e.message)); + await page.route("**/*", fixture(lang).serve); + t.after(() => browser.close()); + await page.goto("http://magpie.test/"); + + // the IDE plugin's: Codex connected here, Claude Code not + const ide = row("air-ide"); + await page.locator(ide).waitFor(); + await page.locator(`${ide} .ag-link`, { hasText: DETAILS[lang] }).click(); + const lines = page.locator(`${ide} .ag-exp .ag-vl`); + await lines.first().waitFor(); + const all = await text(lines); + for (const k of [ + "In Air's agent menu, pick Magpie: the model here is Magpie's, and magpie's models are in its model menu.", + "Air's own Codex and Claude Agent don't take the model here: they run the Codex and Claude Code on this computer, with those agents' own settings.", + "Codex is connected here, so Air's Codex lists magpie's models too: pick one in its model menu, in a new Codex task.", + ]) assert.ok(all.includes(say(lang, k)), `${JSON.stringify(say(lang, k))} not in ${JSON.stringify(all)}`); + assert.deepEqual(await text(page.locator(`${ide} .ag-exp .ag-air-own`)), [say(lang, "Claude Code isn't connected here, so Air's Claude Agent doesn't go through magpie.")]); + const fits = async (loc) => { + const box = await loc.first().boundingBox(); + assert.ok(box.width <= width && box.height > 0, JSON.stringify(box)); + assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth), "the page scrolls sideways"); + }; + await fits(page.locator(`${ide} .ag-exp .ag-air-own`)); + + // the app's: never through magpie, whatever is connected here + const app = row("air"); + await page.locator(`${app} .ag-link`, { hasText: DETAILS[lang] }).click(); + const own = page.locator(`${app} .ag-exp .ag-air-own`); + await own.first().waitFor(); + assert.deepEqual(await text(own), [say(lang, "Air's own agents (Codex, Claude Agent…) run on Air's own sign-in and settings, not through magpie: only Magpie in its agent menu takes magpie's models.")]); + await fits(own); + assert.deepEqual(errors, []); + }); + } + } +}