Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.
provider: ZCode's mover min is 0.1.34, whose card names a gift plan that starts later
yetoned9431dd2ec24
diff --git a/internal/gui/assets/i18n.js b/internal/gui/assets/i18n.jsindex 6db0ce73b..a4c91ba9f 100644--- a/internal/gui/assets/i18n.js+++ b/internal/gui/assets/i18n.js@@ -1833,6 +1833,7 @@ const I18N = {"Extra usage": "额外用量","Gift plans to claim in the ZCode app": "待在 ZCode 客户端领取的赠送额度","ZCode gift plans (-Trial models) need ZCode's sign-in": "ZCode 赠送额度(-Trial 模型)需要 ZCode 登录",+ "ZCode gift plan not started yet": "尚未生效的 ZCode 赠送额度","Code": "验证码","Sign-in didn't finish": "登录未完成","Try again": "重试",@@ -5938,6 +5939,7 @@ const I18N = {"Extra usage": "額外用量","Gift plans to claim in the ZCode app": "待在 ZCode 用戶端領取的贈送額度","ZCode gift plans (-Trial models) need ZCode's sign-in": "ZCode 贈送額度(-Trial 模型)需要 ZCode 登入",+ "ZCode gift plan not started yet": "尚未生效的 ZCode 贈送額度","Code": "驗證碼","Sign-in didn't finish": "登入未完成","Try again": "重試",@@ -10020,6 +10022,7 @@ const I18N = {"Extra usage": "追加使用量","Gift plans to claim in the ZCode app": "ZCode アプリで受け取れるギフト枠","ZCode gift plans (-Trial models) need ZCode's sign-in": "ZCode のギフト枠(-Trial モデル)には ZCode でのサインインが必要",+ "ZCode gift plan not started yet": "開始前の ZCode ギフト枠","Code": "コード","Sign-in didn't finish": "サインインが完了しませんでした","Try again": "再試行",@@ -14132,6 +14135,7 @@ const I18N = {"Extra usage": "Zusätzliche Nutzung","Gift plans to claim in the ZCode app": "In der ZCode-App abzuholen","ZCode gift plans (-Trial models) need ZCode's sign-in": "ZCode-Geschenkpläne (-Trial-Modelle) brauchen die ZCode-Anmeldung",+ "ZCode gift plan not started yet": "ZCode-Geschenkplan, noch nicht aktiv","Code": "Code","Sign-in didn't finish": "Anmeldung nicht abgeschlossen","Try again": "Erneut versuchen",diff --git a/internal/gui/tests/quota-name-translated.test.cjs b/internal/gui/tests/quota-name-translated.test.cjsindex ff1c2aa13..25d48c09c 100644--- a/internal/gui/tests/quota-name-translated.test.cjs+++ b/internal/gui/tests/quota-name-translated.test.cjs@@ -20,18 +20,22 @@ const { chromium, webkit } = require("playwright");const assets = path.resolve(__dirname, "../assets");const CLAIM = "Gift plans to claim in the ZCode app";-const quotas = [+// the line for a gift plan that starts later (windy on Discord): the same+// kind of fixed sentence, the plan's name and start as its display+const PENDING = "ZCode gift plan not started yet";+const quotaOf = (line) => [{provider: "zcode", name: "ZCode", icon: "zcode", plan: "GLM Coding Pro", user: "[email protected]",windows: [{ name: "5 hours", used: 25, resetsAt: new Date(Date.now() + 36e5).toISOString() },// the plugin's line: a sentence magpie knows, and a display of its own- { name: CLAIM, used: 0, aside: true, display: "1 · ZCode Trust Build" },+ line,],},];-function serve(lang) {+function serve(lang, line) {+ const quotas = quotaOf(line);const settings = { theme: "light", lang, quotaLeft: false, currency: "usd" };return async (route) => {const url = new URL(route.request().url());@@ -54,21 +58,32 @@ function serve(lang) {// what each language's name reads as; every language magpie has, so a long// one can't be added later without this failing-const words = {+const claimWords = {en: CLAIM,zh: "待在 ZCode 客户端领取的赠送额度","zh-TW": "待在 ZCode 用戶端領取的贈送額度",ja: "ZCode アプリで受け取れるギフト枠",de: "In der ZCode-App abzuholen",};+const pendingWords = {+ en: PENDING,+ zh: "尚未生效的 ZCode 赠送额度",+ "zh-TW": "尚未生效的 ZCode 贈送額度",+ ja: "開始前の ZCode ギフト枠",+ de: "ZCode-Geschenkplan, noch nicht aktiv",+};+const lines = [+ { what: "claim", words: claimWords, window: { name: CLAIM, used: 0, aside: true, display: "1 · ZCode Trust Build" } },+ { what: "not started", words: pendingWords, window: { name: PENDING, used: 0, aside: true, display: "Start Plan · 2026-10-29 23:00" } },+];// 440 is the narrowest the card is really seen at, 560 the window's minimum;// 1000 is there because that is the width the old test used and it passedconst widths = [440, 560, 1000];for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {- for (const lang of Object.keys(words)) {- test(`${engine} ${lang}: a window's name reads in the language, its display as it came`, async (t) => {+ for (const { what, words, window: line } of lines) for (const lang of Object.keys(words)) {+ test(`${engine} ${lang}: a window's name reads in the language, its display as it came (${what})`, async (t) => {const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" }));t.after(() => browser.close());const errors = [];@@ -76,7 +91,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",const page = await (await browser.newContext({ viewport: { width, height: 900 }, reducedMotion: "reduce" })).newPage();page.setDefaultTimeout(5000);page.on("pageerror", (e) => errors.push(e.message));- await page.route("**/*", serve(lang));+ await page.route("**/*", serve(lang, line));await page.goto("http://magpie.test/?view=usage");const card = page.locator(".subscription-card", { hasText: "ZCode" });await card.waitFor();@@ -84,7 +99,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",assert.ok(labels.includes(words[lang]), `the name reads as ${lang} at ${width}px: ${JSON.stringify(labels)}`);// the plugin's own display: the count and the plan's name, untranslatedconst count = (await card.locator(".quota-n").last().innerText()).replace(/\s+/g, " ").trim();- assert.equal(count, "1 · ZCode Trust Build", `the display at ${width}px`);+ assert.equal(count, line.display, `the display at ${width}px`);// and the name is whole: .quota-labels > span is nowrap with no// ellipsis, so anything wider than its .quota is cut off in silenceconst fit = await page.evaluate(() => {diff --git a/internal/provider/migrate_zcode.go b/internal/provider/migrate_zcode.goindex f368e157d..01a99b346 100644--- a/internal/provider/migrate_zcode.go+++ b/internal/provider/migrate_zcode.go@@ -20,7 +20,7 @@ import (func init() {movers["zcode"] = &mover{pkg: "@magpie-community/opencode-zcode-auth",- min: "0.1.33", // 0.1.33: ZCode 3.16's key-location sign-in lists its GLM Coding Plan's models (GLM-5.3 among them) from the key it reads, not the Start Plan's, and a key that can't be read keeps the list magpie had (plugins#439, dinghao-8); 0.1.32: a 429 that is the plan's in-flight cap (3008/3009) is asked again, the same bytes, for about ten seconds before it goes on, is not counted as a spent gift, and maxConcurrency 3 is declared as a default magpie's per-account queue applies (plugins#395, ANDY-JK); 0.1.31: ZCode 3.16's sign-in that keeps only a project-key-location record reads that key, so its GLM Coding Plan is found, not only the gift (plugins#410); conversation named in x-session-id as a bare UUID (plugins#388); 0.1.30: a GLM Coding Plan or team request names the device in metadata.user_id as ZCode's client does on every request, when the agent sent none (plugins #387); 0.1.29: a sign-in keeps the account's user id, for two accounts of one name to be told apart (wakkana on Discord); 0.1.28: plugins #369, #379; 0.1.27: the Start Plan's 405 code 3012 says ZCode's risk control blocked the account (provider.ZCodeRestrictedHint), which rests it as restricted, not "a network block of this IP" (plugins #348); 0.1.26: a signed-in account's ZCode gift plans keep their -Trial models when ZCode's config is out of reach (no fall back to the last list), a failed gift read is asked again in a minute rather than ten, and a card with an API key or an expired ZCode session says its gift plans need ZCode's sign-in (bigsteven on Discord, plugins cc0bd90); 0.1.25: a GLM Coding Plan key on an account with no plan says ZCode's gift plans (the Start Plan, ZCode 1024 Dev Day) are spent only with ZCode's sign-in, on its card and on a 1113 refusal, rather than an empty card and a bare "余额不足" (rtbeilin on X, plugins 71021b8); 0.1.24: Claude Code's ToolSearch goes to ZCode's plans as ToolSearchTool and tools go without defer_loading, since api.z.ai shows the model no tool but a tool_reference's beside a tool named ToolSearch, so a Claude Code subagent saw no Bash, Read or Write (小八 on Discord, plugins d1b6500); 0.1.23: with two gift plans (the 1024 Dev Day and the new-user plan) each bucket is named after its plan and the ones a request spends come first, so a spent plan's GLM-5.3 no longer hides another plan's (01huadalang on Discord, plugins 1f8d38b); 0.1.22: a Start Plan request goes with ZCode 3.16.3's headers alone (x-zcode-query-source, X-Os-Version as os.release()), never the agent's (Claude Code's anthropic-beta, x-app, x-stainless-*), and without ?beta=true (01huadalang on Discord); 0.1.21: a Start Plan request sends the agent's system prompt at the end of ZCode's third system block, as ZCode joins every dynamic section, since zcode.z.ai refuses a fourth block with 405/3012 (plugins #343); 0.1.20: a team's GLM Coding Plan signs in beside the account's own, as an account of its own named "<email> (team)" (plugins #285); 0.1.19: the personal plan's resets, and the team's, carry each reset's end and window; a Start Plan refusal carries the built-in's hint; 0.1.18: the ZCode app's sign-in reads ZCode 3.15's GLM Coding Plan key from config.json (provider["builtin:*-coding-plan"].options.apiKey), so a valid plan no longer reads as "no plan", as the built-in does since 1d8e83a79 (#2130); 0.1.17: the ZCode app's sign-in reads credentials.json from the folder ZCode's data was moved to in its settings (数据存储路径, dataBaseDir in the home folder's setting.json), as the built-in does since 41972b25f (flower on Discord); 0.1.16's ZCode app's sign-in follows ZCode only while it is signed in to the same account, so an entry added for one account never sends with another's credentials after ZCode switched (LingYi_Stu on X); 0.1.15's Start Plan request says the agent's folder and git repository as magpie tells them, never magpie's own folder, and leaves out what it doesn't know (plugins #86); 0.1.14's gift-only account lists its gift's models by their own names, as ZCode does, so a Start Plan GLM-5.3 bucket's model is listed as GLM-5.3, not only GLM-5.3-Trial (#1261, plugins aca7c59); 0.1.13's claim line has one fixed name, which the GUI translates, so it no longer shares the "ZCode Trust Build" bucket window's name (plugins #43); 0.1.12's counted window carries its amount and limit, so the card's count follows used/left (#659, plugins #35); 0.1.11's gift plan ZCode holds but hasn't granted is named on the card, to claim in the ZCode app (plugins #30, #1001); 0.1.10's gift-only buckets and 0.1.9's trial entries (plugins #21) kept+ min: "0.1.34", // 0.1.34: a gift plan whose starts_at is still to come (a Start Plan taking effect at 23:00 today) is named on the card with its start ("ZCode gift plan not started yet") and gets no requests before it, and beside a GLM Coding Plan every gift bucket carries its plan's name ("Start Plan · GLM-5.1-Trial") (windy on Discord, plugins 3b3209e); 0.1.33: ZCode 3.16's key-location sign-in lists its GLM Coding Plan's models (GLM-5.3 among them) from the key it reads, not the Start Plan's, and a key that can't be read keeps the list magpie had (plugins#439, dinghao-8); 0.1.32: a 429 that is the plan's in-flight cap (3008/3009) is asked again, the same bytes, for about ten seconds before it goes on, is not counted as a spent gift, and maxConcurrency 3 is declared as a default magpie's per-account queue applies (plugins#395, ANDY-JK); 0.1.31: ZCode 3.16's sign-in that keeps only a project-key-location record reads that key, so its GLM Coding Plan is found, not only the gift (plugins#410); conversation named in x-session-id as a bare UUID (plugins#388); 0.1.30: a GLM Coding Plan or team request names the device in metadata.user_id as ZCode's client does on every request, when the agent sent none (plugins #387); 0.1.29: a sign-in keeps the account's user id, for two accounts of one name to be told apart (wakkana on Discord); 0.1.28: plugins #369, #379; 0.1.27: the Start Plan's 405 code 3012 says ZCode's risk control blocked the account (provider.ZCodeRestrictedHint), which rests it as restricted, not "a network block of this IP" (plugins #348); 0.1.26: a signed-in account's ZCode gift plans keep their -Trial models when ZCode's config is out of reach (no fall back to the last list), a failed gift read is asked again in a minute rather than ten, and a card with an API key or an expired ZCode session says its gift plans need ZCode's sign-in (bigsteven on Discord, plugins cc0bd90); 0.1.25: a GLM Coding Plan key on an account with no plan says ZCode's gift plans (the Start Plan, ZCode 1024 Dev Day) are spent only with ZCode's sign-in, on its card and on a 1113 refusal, rather than an empty card and a bare "余额不足" (rtbeilin on X, plugins 71021b8); 0.1.24: Claude Code's ToolSearch goes to ZCode's plans as ToolSearchTool and tools go without defer_loading, since api.z.ai shows the model no tool but a tool_reference's beside a tool named ToolSearch, so a Claude Code subagent saw no Bash, Read or Write (小八 on Discord, plugins d1b6500); 0.1.23: with two gift plans (the 1024 Dev Day and the new-user plan) each bucket is named after its plan and the ones a request spends come first, so a spent plan's GLM-5.3 no longer hides another plan's (01huadalang on Discord, plugins 1f8d38b); 0.1.22: a Start Plan request goes with ZCode 3.16.3's headers alone (x-zcode-query-source, X-Os-Version as os.release()), never the agent's (Claude Code's anthropic-beta, x-app, x-stainless-*), and without ?beta=true (01huadalang on Discord); 0.1.21: a Start Plan request sends the agent's system prompt at the end of ZCode's third system block, as ZCode joins every dynamic section, since zcode.z.ai refuses a fourth block with 405/3012 (plugins #343); 0.1.20: a team's GLM Coding Plan signs in beside the account's own, as an account of its own named "<email> (team)" (plugins #285); 0.1.19: the personal plan's resets, and the team's, carry each reset's end and window; a Start Plan refusal carries the built-in's hint; 0.1.18: the ZCode app's sign-in reads ZCode 3.15's GLM Coding Plan key from config.json (provider["builtin:*-coding-plan"].options.apiKey), so a valid plan no longer reads as "no plan", as the built-in does since 1d8e83a79 (#2130); 0.1.17: the ZCode app's sign-in reads credentials.json from the folder ZCode's data was moved to in its settings (数据存储路径, dataBaseDir in the home folder's setting.json), as the built-in does since 41972b25f (flower on Discord); 0.1.16's ZCode app's sign-in follows ZCode only while it is signed in to the same account, so an entry added for one account never sends with another's credentials after ZCode switched (LingYi_Stu on X); 0.1.15's Start Plan request says the agent's folder and git repository as magpie tells them, never magpie's own folder, and leaves out what it doesn't know (plugins #86); 0.1.14's gift-only account lists its gift's models by their own names, as ZCode does, so a Start Plan GLM-5.3 bucket's model is listed as GLM-5.3, not only GLM-5.3-Trial (#1261, plugins aca7c59); 0.1.13's claim line has one fixed name, which the GUI translates, so it no longer shares the "ZCode Trust Build" bucket window's name (plugins #43); 0.1.12's counted window carries its amount and limit, so the card's count follows used/left (#659, plugins #35); 0.1.11's gift plan ZCode holds but hasn't granted is named on the card, to claim in the ZCode app (plugins #30, #1001); 0.1.10's gift-only buckets and 0.1.9's trial entries (plugins #21) keptagents: []string{"zcode"},out: func() ([]Moving, error) {var out []Moving