Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.
gui: Claude Code's unset subagents read "Claude Code's own pick", not "same as model"
yetone2ea148b1033b
diff --git a/docs/subsystems/agent-wiring.md b/docs/subsystems/agent-wiring.mdindex 97445d127..923ec0a19 100644--- a/docs/subsystems/agent-wiring.md+++ b/docs/subsystems/agent-wiring.md@@ -86,6 +86,7 @@ something else shows up as drift.- Claude Code's `/model` list (`modelPicker` in its settings.json) is magpie's while it is marked in the stash (`claude.model_picker`, `claude@wsl:<distro>.model_picker` for a WSL distro) or while every row's description ends "via magpie", as every row magpie writes does (`magpiesPicker` in [`claude.go`](../../internal/agent/claude.go)). magpie keeps its own list up to date on every model set and `Sync`, and removes it when Claude Code is taken off magpie; a list the user wrote is left alone. The fingerprint covers a list whose mark an older magpie's stash lost, which otherwise stayed without every model added since (#2046).- Claude Code 2.1.296 reads a Claude model whose version has a dot (`relay/claude-opus-4.6-us`) as Claude Opus 4: a retired warning, budget thinking, 32000 output tokens, no effort. With dashes (`relay/claude-opus-4-6-us`) it knows the model (misteer_ti. on Discord). So every model magpie writes into its settings (`model`, the tier envs, `ANTHROPIC_SMALL_FAST_MODEL`, `CLAUDE_CODE_SUBAGENT_MODEL`, `CLAUDE_CODE_AUTO_MODE_MODEL`, `modelPicker`), T3 Code's Claude slugs and Claude Desktop's Code-tab ids (`claudeLooking`) spell a dotted Claude version with dashes (`provider.ClaudeSpelled`), only when that spelling stands for one served id. A Claude model listed to Desktop with reasoning levels is given as `magpie-<n>.anthropic.<model>`, its dotted version dashed as well (`claudeModel`: Copilot's `claude-opus-5.5` is `…anthropic.claude-opus-5-5`, which Claude Code knows; it was `mythos-magpie-<n>`, an unknown model, and Haiku 4.5 got an effort Copilot refuses, #1819); a request for it is served by `<n>` alone (`aliased`), so that spelling needn't be unique. Mythos counts as Claude here too: Claude Code matches `claude-mythos-5-1` by substring, so `claude-mythos-5.1` would read as Mythos 5. Every read of those keys takes it back (`provider.ClaudeRead`: `claudeIn`'s `env`, `claudeMain`, `claudeStandInAt`), so magpie's fields, applied state and Drift keep the dotted id. The user's own values are stashed and given back as written. Values an older magpie wrote dotted are rewritten on the next Sync. Other vendors' ids are never respelled ([`claudedash.go`](../../internal/provider/claudedash.go)).- Codex's "subagents" field is `[agents] default_subagent_model`: only the model a subagent starts on when its lead names none in `spawn_agent` (codex-rs `core/src/agent/child_config.rs`). Unset, it isn't "same as model": the lead may still name another, so the GUI calls it the lead's pick, else the model (`leadPicks` in app.js), and its title points at the "subagent model" field.+- Claude Code's "subagents" field is `env.CLAUDE_CODE_SUBAGENT_MODEL`. Unset, magpie writes nothing there (`writeTiers`, `setSubagent`), and Claude Code picks: the Agent tool call's model, then the subagent's own frontmatter model, then the variable, then the lead's model (Claude Code 2.1.306; the built-in Explore inherits, capped at opus). So the GUI calls unset "Claude Code's own pick" (`claudePicks` in app.js), not "same as model" (KorenKrita on Discord).- Codex's "subagent model" field writes nothing to Codex's config: its lead names each subagent's model in `spawn_agent`, which `[agents]` can't overrule. It is magpie's setting (`settings.CodexSubagentModel`, [`codex_subagent.go`](../../internal/provider/codex_subagent.go)), and the gateway moves the subagent's request onto it (see [gateway routing](gateway-routing.md)). Its options are every model and routing group Codex's own lists show (`CatalogFor("codex")`, so a model taken out of them or not picked is left out here too), ChatGPT accounts' first (#1633: a lead on a chat provider wants its subagents there too). A task a ChatGPT-backed lead sealed opens only on a ChatGPT account, so the gateway keeps such a subagent on its own model when the one set is another provider's. Its setter takes any `provider/model` or `group/<id>`, also one magpie doesn't serve now, so a profile or backup put back on another computer still applies (`ApplyFields` stops at the first failed Set), and refuses one of Codex's own bare names.- Claude Desktop's "subagent model" field (`subagent_model`, `desktopSubagentField` in [`claudedesktop.go`](../../internal/agent/claudedesktop.go)) writes nothing to Desktop's config: Desktop runs its Code tab's Claude Code with `CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST=1`, under which Claude Code ignores `CLAUDE_CODE_SUBAGENT_MODEL`, `CLAUDE_CODE_SUBAGENT_MODEL_FORCE` and the tier variables in its settings files' `env` ("Ignoring … this session's provider routing is managed by the host", Claude Code 2.1.295), and the env Desktop builds for the Code tab has no key for it (Desktop 2.31226). It is magpie's setting (`settings.DesktopSubagentModel`, [`desktop_subagent.go`](../../internal/provider/desktop_subagent.go)), and the gateway moves each subagent's turn onto it (see [gateway routing](gateway-routing.md)). It is labelled as Codex's, so the Agents page gives it the same square. Its options are magpie's models and groups as Desktop's list shows them (`viaMagpie("claude-desktop")`), while Desktop is on magpie, as for the tiers. A Desktop alias picked is kept by its catalog id (`DesktopCatalogID`). Like Codex's, its setter takes any `provider/model` or `group/<id>`, also one magpie doesn't serve now, so a profile or backup still applies, and refuses a bare name. It is `Live`: the gateway reads it on each request.- Claude Desktop's "subagent effort" (`desktopSubagentEffortField`, `settings.DesktopSubagentEffort`) is also Quiet and Live. Default keeps the effort the request asks for, including disabled thinking; it never selects a new default. A picked level works independently of the subagent model: no model pick, the same model and an unavailable model pick all still take the effort. While wired, the field offers the selected model's levels, or the standard levels when its model is inherited or unavailable; a model marked reasonless offers none. The stored pick survives model changes. A disconnected preference can be saved or cleared without connecting Desktop or showing restart advice, so profile restoration and Disconnect can restore a value saved before connecting; reconnect returns to the last live pick. `subEffortTitle` gives Desktop the Claude Code default explanation; Codex's default meaning is unchanged. The gateway fits each attempt to its actual model and preserves fixed group-member efforts (see [gateway routing](gateway-routing.md)).diff --git a/internal/agent/claude_tier_pick_test.go b/internal/agent/claude_tier_pick_test.goindex 2ee91b45b..45ed8a81b 100644--- a/internal/agent/claude_tier_pick_test.go+++ b/internal/agent/claude_tier_pick_test.go@@ -96,3 +96,44 @@ func TestClaudeTierPickedAsTheMainModelStays(t *testing.T) {}}}++// Claude Code's subagents left unset are Claude Code's pick (KorenKrita on+// Discord): magpie writes no CLAUDE_CODE_SUBAGENT_MODEL, through a pick+// taken back and a main model moved, so Claude Code takes the Agent call's+// model, then the subagent's own, then the session's (2.1.306).+func TestClaudeSubagentsUnsetWriteNothing(t *testing.T) {+ home, _ := codexHome(t, "", "")+ a := claude(home)+ if err := provider.Save(provider.Provider{ID: "oa", Name: "OA", Chat: "https://oa.example/v1", Key: "k",+ Models: []string{"k2.8-preview", "glm-6"}}); err != nil {+ t.Fatal(err)+ }+ path := filepath.Join(home, ".claude", "settings.json")+ none := func(when string) {+ t.Helper()+ if v, has := edit.GetJSON(path, "env.CLAUDE_CODE_SUBAGENT_MODEL"); has {+ t.Fatalf("%s: CLAUDE_CODE_SUBAGENT_MODEL is %q, not left to Claude Code\n%s", when, v, readFile(path))+ }+ if v := a.Values()["subagent"]; v != "" {+ t.Fatalf("%s: subagents read %q", when, v)+ }+ }+ if err := a.Apply("model", "oa/k2.8-preview"); err != nil {+ t.Fatal(err)+ }+ none("routed")+ if err := a.Apply("subagent", "oa/glm-6"); err != nil {+ t.Fatal(err)+ }+ if v, _ := edit.GetJSON(path, "env.CLAUDE_CODE_SUBAGENT_MODEL"); v == "" {+ t.Fatalf("a model picked isn't written\n%s", readFile(path))+ }+ if err := a.Apply("subagent", ""); err != nil {+ t.Fatal(err)+ }+ none("taken back")+ if err := a.Apply("model", "oa/glm-6"); err != nil {+ t.Fatal(err)+ }+ none("main model moved")+}diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.jsindex 2ff9dacb7..a99bdd23b 100644--- a/internal/gui/assets/app.js+++ b/internal/gui/assets/app.js@@ -433,7 +433,8 @@ function renderAgents() {const fieldBtn = (f, cls) => {const b = el("button", "field " + cls);const opt = optionFor(f, f.value);- b.title = t("{label}: {value}", { label: t(f.label), value: f.value || t("agent default") }) + (opt?.note ? ` · ${opt.note}` : "");+ b.title = claudePicks(a, f) && !f.value ? t("{label}: {value}", { label: t(f.label), value: t(AUTO_MODE_UNSET) }) + "\n" + t(CLAUDE_PICKS)+ : t("{label}: {value}", { label: t(f.label), value: f.value || t("agent default") }) + (opt?.note ? ` · ${opt.note}` : "");if (f.value && opt?.direct) b.title += "\n" + directSaid(a, opt);const effort = f.key === "effort" || f.label === "effort" || f.label === "thinking" || TIER_EFFORTS.includes(f.label);if (opt?.icon || opt?.icons?.length) b.append(optionIcon(opt));@@ -443,7 +444,7 @@ function renderAgents() {else if (!f.value && !f.menu && a.icon) b.append(icon(a.icon));else if (!wide(f) || !f.value) b.append(el("span", "k", t(f.label)));if ((f.label === "executor" || f.label === "planner") && !b.querySelector(".k")) b.append(el("span", "k", t(f.label)));- const shown = f.menu ? f.summary : effort ? effortName(opt || { value: f.value }) : (opt?.label || f.value || t(FOLLOWS_MODEL.includes(f.label) ? "same as model" : "default"));+ const shown = f.menu ? f.summary : effort ? effortName(opt || { value: f.value }) : (opt?.label || f.value || t(claudePicks(a, f) ? AUTO_MODE_UNSET : FOLLOWS_MODEL.includes(f.label) ? "same as model" : "default"));if (f.menu) b.title = f.options.map((o) => `${o.label}: ${o.note}`).join("\n");b.append(el("span", "v" + (f.value || f.custom ? "" : " empty"), shown));if (f.value && opt?.fast) b.append(fastTag(opt.ultra));@@ -3703,8 +3704,14 @@ const SUB_MODEL = "subagent model";// pick, not the model'sconst AUTO_MODE = "auto mode";const AUTO_MODE_UNSET = "Claude Code's own pick";-const leadPicks = (a, f) => f.label === "subagents" && a.id.split("@wsl:")[0] === "codex";+const leadPicks = (a, f) => f.label === "subagents" && ["codex", "claude"].includes(a.id.split("@wsl:")[0]);const LEAD_PICKS = "Codex's lead may name another model for a subagent; set the subagent model to hold every subagent to one";+// Claude Code's subagents unset: magpie writes no CLAUDE_CODE_SUBAGENT_MODEL+// and Claude Code picks, taking the Agent call's model, then the subagent's+// own model:, then that variable, then the session's (2.1.306), so it is+// its pick, not "same as model" (KorenKrita on Discord)+const CLAUDE_PICKS = "Claude Code's lead, or a subagent's own definition, may name a model or tier for it; a model set here is for the subagents that name none";+const claudePicks = (a, f) => leadPicks(a, f) && a.id === "claude";const extra = (f) => f.key === "tiers" || FOLLOWS_MODEL.includes(f.label) || f.label === "sign-in" || f.key === "ultracode" || f.label === SUB_EFFORT || f.label === SUB_MODEL || f.label === AUTO_MODE || f.label === MEMORIES;const EXTRA_GLYPH = {subagents: "M4.5 2.75v10.5M4.5 9.25c0-2.2 1.6-3.75 3.9-3.75h3.35M9.9 3.6l1.9 1.9-1.9 1.9",@@ -3733,7 +3740,7 @@ function extraField(a, f) {b.append(svg(EXTRA_GLYPH[f.label] || EXTRA_GLYPH.tiers, 13, 1.5));const opt = optionFor(f, f.value);b.title = f.label === SUB_EFFORT ? subEffortTitle(a, f, opt) : f.menu ? menuTitle(f)- : t("{label}: {value}", { label: f.label === MEMORIES ? t("Codex memories model") : t(f.label), value: t(opt?.label || f.value || (f.label === MEMORIES ? MEMORIES_DEFAULT : f.label === SUB_MODEL ? "the model the lead asks for" : f.label === AUTO_MODE ? AUTO_MODE_UNSET : leadPicks(a, f) ? "the lead's pick, else same as model" : "same as model")) }) + (opt?.note && !FOLLOWS_MODEL.includes(f.label) ? "\n" + t(opt.note) : "") + (leadPicks(a, f) ? "\n" + t(LEAD_PICKS) : "");+ : t("{label}: {value}", { label: f.label === MEMORIES ? t("Codex memories model") : t(f.label), value: t(opt?.label || f.value || (f.label === MEMORIES ? MEMORIES_DEFAULT : f.label === SUB_MODEL ? "the model the lead asks for" : f.label === AUTO_MODE ? AUTO_MODE_UNSET : leadPicks(a, f) ? "the lead's pick, else same as model" : "same as model")) }) + (opt?.note && !FOLLOWS_MODEL.includes(f.label) ? "\n" + t(opt.note) : "") + (leadPicks(a, f) ? "\n" + t(claudePicks(a, f) ? CLAUDE_PICKS : LEAD_PICKS) : "");b.setAttribute("aria-label", b.title);b.dataset.key = f.key;b.onclick = (ev) => openPicker(a, f, b, ev);@@ -4600,7 +4607,8 @@ function openPicker(agent, field, anchor, ev, only) {if (FOLLOWS_MODEL.includes(field.label)) {const main = agent.fields.find((f) => f.key === "model");const mainName = main && (optionFor(main, main.value)?.label || main.value);- options.unshift(main && leadPicks(agent, field) ? { value: "", label: t("Lead's pick"), note: t("{model} unless the lead names another", { model: mainName }), icon: optionFor(main, main.value)?.icon, reset: true }+ options.unshift(main && claudePicks(agent, field) ? { value: "", label: t(AUTO_MODE_UNSET), note: t("{model} unless the lead or the subagent names another", { model: mainName }), icon: agent.icon, reset: true }+ : main && leadPicks(agent, field) ? { value: "", label: t("Lead's pick"), note: t("{model} unless the lead names another", { model: mainName }), icon: optionFor(main, main.value)?.icon, reset: true }: main ? { value: "", label: t("Same as model"), note: mainName, icon: optionFor(main, main.value)?.icon, reset: true }: { value: "", label: t("Not set"), note: t("a Claude model of the tier, else the chat's model"), icon: agent.icon, reset: true });} else if (!only && !field.menu && !field.onPick && !options.some((o) => o.value === "")) {diff --git a/internal/gui/assets/i18n.js b/internal/gui/assets/i18n.jsindex 9ebcba4b3..3e4f58d01 100644--- a/internal/gui/assets/i18n.js+++ b/internal/gui/assets/i18n.js@@ -3230,6 +3230,8 @@ const I18N = {"Lead's pick": "由主代理自选","{model} unless the lead names another": "{model},主代理指定其他模型时除外","Codex's lead may name another model for a subagent; set the subagent model to hold every subagent to one": "Codex 的主代理可以给子代理指定别的模型;要让每个子代理都用同一个模型,请设置子代理模型",+ "Claude Code's lead, or a subagent's own definition, may name a model or tier for it; a model set here is for the subagents that name none": "Claude Code 的主代理或子代理自己的定义可以给它指定模型或档位;这里设置的模型只用于没有指定的子代理",+ "{model} unless the lead or the subagent names another": "{model},主代理或子代理指定其他模型时除外","the model the lead asks for": "主代理请求的模型","each subagent on the model {agent}'s lead asks for": "每个子代理都用 {agent} 主代理请求的模型","auto mode": "自动模式",@@ -7070,6 +7072,8 @@ const I18N = {"Lead's pick": "由主代理自選","{model} unless the lead names another": "{model},主代理指定其他模型時除外","Codex's lead may name another model for a subagent; set the subagent model to hold every subagent to one": "Codex 的主代理可以給子代理指定別的模型;要讓每個子代理都用同一個模型,請設定子代理模型",+ "Claude Code's lead, or a subagent's own definition, may name a model or tier for it; a model set here is for the subagents that name none": "Claude Code 的主代理或子代理自己的定義可以給它指定模型或檔位;這裡設定的模型只用於沒有指定的子代理",+ "{model} unless the lead or the subagent names another": "{model},主代理或子代理指定其他模型時除外","the model the lead asks for": "主代理請求的模型","each subagent on the model {agent}'s lead asks for": "每個子代理都用 {agent} 主代理請求的模型","auto mode": "自動模式",@@ -10928,6 +10932,8 @@ const I18N = {"Lead's pick": "リードが選ぶ","{model} unless the lead names another": "{model}(リードが別のモデルを指定した場合を除く)","Codex's lead may name another model for a subagent; set the subagent model to hold every subagent to one": "Codex のリードはサブエージェントに別のモデルを指定できます。すべてのサブエージェントを同じモデルにするには、サブエージェントのモデルを設定してください",+ "Claude Code's lead, or a subagent's own definition, may name a model or tier for it; a model set here is for the subagents that name none": "Claude Code のリードやサブエージェント自身の定義が、モデルや階層を指定できます。ここで設定したモデルは、指定のないサブエージェントに使われます",+ "{model} unless the lead or the subagent names another": "{model}(リードかサブエージェントが別のモデルを指定した場合を除く)","the model the lead asks for": "リードがリクエストしたモデル","each subagent on the model {agent}'s lead asks for": "各サブエージェントは {agent} のリードがリクエストしたモデルを使います","auto mode": "自動モード",@@ -14794,6 +14800,8 @@ const I18N = {"Lead's pick": "Wahl des Haupt-Agenten","{model} unless the lead names another": "{model}, außer der Haupt-Agent nennt ein anderes","Codex's lead may name another model for a subagent; set the subagent model to hold every subagent to one": "Der Haupt-Agent von Codex kann einem Subagenten ein anderes Modell geben; setze das Modell der Subagenten, um alle auf eines festzulegen",+ "Claude Code's lead, or a subagent's own definition, may name a model or tier for it; a model set here is for the subagents that name none": "Der Haupt-Agent von Claude Code oder die eigene Definition eines Subagenten kann ihm ein Modell oder eine Stufe geben; ein hier gesetztes Modell gilt für Subagenten, die keines nennen",+ "{model} unless the lead or the subagent names another": "{model}, außer der Haupt-Agent oder der Subagent nennt ein anderes","the model the lead asks for": "das Modell, das der Haupt-Agent anfordert","each subagent on the model {agent}'s lead asks for": "jeder Subagent auf dem Modell, das der Haupt-Agent von {agent} anfordert","auto mode": "Auto-Modus",diff --git a/internal/gui/tests/claude-subagents-pick.test.cjs b/internal/gui/tests/claude-subagents-pick.test.cjsnew file mode 100644index 000000000..50c997380--- /dev/null+++ b/internal/gui/tests/claude-subagents-pick.test.cjs@@ -0,0 +1,117 @@+// Run with Node's test runner and Playwright on the module path; see README.md.+// Claude Code's subagents left unset are Claude Code's pick, not "same as+// model" (KorenKrita on Discord): magpie then writes no+// CLAUDE_CODE_SUBAGENT_MODEL, and Claude Code takes the Agent call's model,+// then the subagent's own model:, then the session's (2.1.306). The+// Subagents line of the opened row's Tiers says so, its title says what a+// model set there is for, and the picker opens on "Claude Code's own pick"+// with the main model in its note; picked, then taken back, it posts the+// model and then "". Every language, Chromium and WebKit, wide and narrow.+// No backend: the API is 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 assets = path.resolve(__dirname, "../assets");+const models = [{ value: "magpie/v/glm", label: "GLM", ref: "v/glm" }, { value: "magpie/v/flash", label: "Flash", ref: "v/flash" }];+const tiers = ["opus", "sonnet", "haiku", "fable"];+const claude = (id, routed) => ({+ id, name: "Claude Code", path: "/test/settings.json", icon: "claudecode-color", wired: routed,+ fields: [+ { key: "model", label: "model", value: routed ? "magpie/v/glm" : "opus", options: routed ? models : [{ value: "opus" }] },+ ...tiers.map((tier) => ({ key: tier, label: tier, value: "", options: models })),+ { key: "subagent", label: "subagents", value: "", options: routed ? models : [] },+ { key: "auto_mode", label: "auto mode", value: "", options: routed ? models : [] },+ ],+});+const fresh = () => ({ agents: [claude("claude", true), claude("cc-own", false)], profiles: [] });++function server(lang, sets) {+ let cur = fresh();+ return async (route) => {+ const req = route.request(), url = new URL(req.url());+ 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 route.fulfill({ json: { ...cur, settings: { lang, theme: "light" } } });+ if (url.pathname === "/api/set") {+ const body = req.postDataJSON();+ sets.push(body);+ cur = JSON.parse(JSON.stringify(cur));+ cur.agents.find((a) => a.id === body.agent).fields.find((f) => f.key === body.field).value = body.value;+ return route.fulfill({ json: { ...cur, settings: { lang, theme: "light" } } });+ }+ if (url.pathname === "/api/usage/quotas") return route.fulfill({ json: [] });+ if (url.pathname === "/api/groups") return route.fulfill({ json: { groups: [] } });+ if (url.pathname === "/api/agents/cli") return route.fulfill({ json: { agents: {}, pending: false } });+ if (url.pathname === "/api/providers") return route.fulfill({ json: { providers: [], gateway: { running: true } } });+ if (url.pathname === "/api/plugins") return route.fulfill({ json: { plugins: [] } });+ if (url.pathname.startsWith("/api/")) return route.fulfill({ 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 });+ };+}++// the words as i18n.js has them+const W = {+ en: { pick: "Claude Code's own pick", note: "GLM unless the lead or the subagent names another", unset: "subagents: Claude Code's own pick",+ says: "Claude Code's lead, or a subagent's own definition, may name a model or tier for it; a model set here is for the subagents that name none" },+ zh: { pick: "由 Claude Code 自己挑选", note: "GLM,主代理或子代理指定其他模型时除外", unset: "子代理:由 Claude Code 自己挑选",+ says: "Claude Code 的主代理或子代理自己的定义可以给它指定模型或档位;这里设置的模型只用于没有指定的子代理" },+ "zh-TW": { pick: "由 Claude Code 自己挑選", note: "GLM,主代理或子代理指定其他模型時除外", unset: "子代理:由 Claude Code 自己挑選",+ says: "Claude Code 的主代理或子代理自己的定義可以給它指定模型或檔位;這裡設定的模型只用於沒有指定的子代理" },+ ja: { pick: "Claude Code が自分で選ぶ", note: "GLM(リードかサブエージェントが別のモデルを指定した場合を除く)", unset: "サブエージェント:Claude Code が自分で選ぶ",+ says: "Claude Code のリードやサブエージェント自身の定義が、モデルや階層を指定できます。ここで設定したモデルは、指定のないサブエージェントに使われます" },+ de: { pick: "wählt Claude Code selbst", note: "GLM, außer der Haupt-Agent oder der Subagent nennt ein anderes", unset: "Subagenten: wählt Claude Code selbst",+ says: "Der Haupt-Agent von Claude Code oder die eigene Definition eines Subagenten kann ihm ein Modell oder eine Stufe geben; ein hier gesetztes Modell gilt für Subagenten, die keines nennen" },+};++const cc = '.row.agent[data-id="claude"]';+const sub = `${cc} .ag-exp .field.ag-pick[data-key="subagent"]`;++for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {+ for (const lang of Object.keys(W)) {+ for (const width of [1100, 560]) {+ test(`${engine} ${lang} ${width}px: Claude Code's subagents unset are its own pick`, async (t) => {+ const w = W[lang];+ const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" }));+ const page = await browser.newPage({ viewport: { width, height: 800 } });+ page.setDefaultTimeout(5000);+ const errors = [], sets = [];+ page.on("pageerror", (e) => errors.push(e.message));+ await page.route("**/*", server(lang, sets));+ t.after(() => browser.close());+ await page.goto("http://magpie.test/");+ await page.locator(cc).waitFor();+ await page.locator(`${cc} .ag-link`).click();+ await page.locator(sub).waitFor();++ const pick = page.locator(sub);+ assert.equal(await pick.locator(".v").textContent(), w.pick);+ assert.equal(await pick.getAttribute("title"), w.unset + "\n" + w.says);+ assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth), "the Agents view overflows");++ const y = await page.evaluate(() => scrollY);+ await pick.click();+ await page.locator("#pop:not([hidden]) #list li").first().waitFor();+ assert.equal(await page.evaluate(() => scrollY), y, "the click scrolled the page");+ const first = await page.locator("#pop #list li").first().innerText();+ assert.ok(first.includes(w.pick) && first.includes(w.note), first);+ await page.locator("#pop #list li", { hasText: "Flash" }).first().click();+ await page.waitForFunction((s) => document.querySelector(s + " .v:not(.empty)"), sub);+ assert.deepEqual(sets, [{ agent: "claude", field: "subagent", value: "magpie/v/flash" }]);++ // its own pick takes the model out again+ await page.locator(sub).click();+ await page.locator("#pop:not([hidden]) #list li").first().waitFor();+ await page.locator("#pop #list li").first().click();+ await page.waitForFunction((s) => document.querySelector(s + " .v.empty"), sub);+ assert.deepEqual(sets.at(-1), { agent: "claude", field: "subagent", value: "" });+ assert.equal(await page.locator(sub).locator(".v").textContent(), w.pick);+ assert.deepEqual(errors, []);+ });+ }+ }+}