agents: Air's row says which of Air's own agents go through magpie (jumy_18634)

jumy_18634 on Discord picked a model on the Air (JetBrains IDEs) row and
found Air's Codex in IDEA 2026.3 still on another model. The model on an
Air row is the Magpie ACP agent's alone, and the row never said so.

What Air's own agents run, read from the jars (air-plugin
262.8665.521, Air app 262.1037.14):
- The IDE plugin's 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 sets no model_provider
  (CodexAppServerProcessKt, CodexCliUtils). Its menu is model/list, its
  default config/read's model, and a task's model goes in thread/start.
  Its Claude Agent runs claude with only Air's hooks in --settings.
  So both are on magpie while Codex / Claude Code are connected here.
- The Air app's Codex runs with a CODEX_HOME of its own and JetBrains'
  gateway ([model_providers.air-gateway]), and never is.

Changed: an Air row, opened, says to pick Magpie in Air's agent menu and
that the model there is Magpie's. The IDE plugin's row says whether
Codex and Claude Code are connected here, and so whether Air's Codex and
Claude Agent go through magpie; the app's says its own agents don't
(airSaid in app.js, words in zh, zh-TW, ja, de). air.go's comment and
docs/subsystems/agent-wiring.md say what the jars showed, in place of
"not tried in an IDE". Six Agents-page comments in app.js are cut to one
line each to keep the core under its budget, no raise.

Run at the pushed head, on mote:
- Codex 0.166.0 `codex -c check_for_update_on_startup=false app-server`,
  as Air starts it, in a sandbox HOME with a magpie-style config.toml
  (model_catalog_json, model_provider magpie on a fake gateway at
  127.0.0.1:3599): model/list gave the catalog's two models, config/read
  the config's model; after config.toml changed under the running
  server, config/read gave the new model; a thread/start with model
  kimi/kimi-k3 (as Air's CodexThreadStartParams sends it) and a turn
  sent /v1/responses with model kimi/kimi-k3 to the gateway.
- GUI: agent-air-own.test.cjs (new), chromium and webkit, en zh zh-TW ja
  de, 1100 and 640px: 20 of 20.
  The 166 GUI files that reach the Agents page or i18n, both engines:
  red only in page-width-steady, found-skill-pick-remove, mobile-web and
  remote-magpie, which fail the same way alone on origin/main affa979d5
  (#5013), and nav-timeout, which fails at the old base and passes after
  the rebase.
- go test -tags nogui ./internal/agent -run 'Air|Notice', ./internal/gui
  -run 'Budget|I18n|Air|Notice': ok. GOOS=linux and GOOS=windows go vet
  -tags nogui ./internal/agent ./internal/gui: ok. gofmt -l: clean.

Broken by hand: without the Air branch in connectPanel,
agent-air-own.test.cjs is red, 10 of 10 in chromium.

Not tried: Air itself (no JetBrains IDE on this Mac or mote); a real
Codex or Claude Code connected through Air; Air on Windows or in WSL.
Air's bundled codex isn't among the running copies the Codex row names
as on an old list.
This commit is contained in:
yetone
2026-11-03 13:02:15 +08:00
parent e189542dfb
commit 2c214ce252
6 changed files with 161 additions and 49 deletions
+1 -1
View File
@@ -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 `<level>-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`).
+11 -5
View File
@@ -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")
+20 -42
View File
@@ -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))));
+28
View File
@@ -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",
File diff suppressed because one or more lines are too long
+100
View File
@@ -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, []);
});
}
}
}