site: the home page in Chinese at /zh/, and made for phones (the owner: magpie官网加上多语言支持,另外官网要对移动端友好) — index.html stays the one English source, each string marked data-i18n / data-i18n-attr; the worker serves /zh/ from it with i18n.js's dictionary put in by HTMLRewriter (<html lang>, docs links to /docs/zh/…, canonical and hreflang alternates), and / sends a browser whose Accept-Language prefers Chinese there until a language is picked with the nav's 中文/EN link (the lang cookie; Vary: Accept-Language, Cookie). The routing demo, copy button, download label and theme titles speak Chinese on it; the zh docs' home links go to /zh/. On phones the nav's links fold into a menu (≤860px; Escape, a click outside or on a link closes it, aria-expanded kept), Discord and GitHub move into it under 560px, the footer wraps, the routing tabs wrap, and nothing scrolls sideways at 320, 390, 768 or 1280 in either language (WebKit, light and dark). worker.test.mjs checks every marked key has its Chinese and the dictionary has none unused, and the / redirect by Accept-Language and cookie.
<metaname="description"content="One place to pick every agent's model. Codex on DeepSeek, Claude Code on Kimi, Gemini CLI on GLM, from the menu bar, through one local gateway.">
<metaname="description"data-i18n-attr="content:meta.desc"content="One place to pick every agent's model. Codex on DeepSeek, Claude Code on Kimi, Gemini CLI on GLM, from the menu bar, through one local gateway.">
<metaname="color-scheme"content="light dark">
<metaname="theme-color"content="#fafafa">
<script>
// The chosen theme (light, dark, or the system's) is on <html data-theme>
// before anything paints.
// The page is English, or Chinese when the worker served it at /zh/.
font:16px/1.6-apple-system,BlinkMacSystemFont,"SF Pro Text","Inter","Segoe UI",system-ui,sans-serif;
font:16px/1.6-apple-system,BlinkMacSystemFont,"SF Pro Text","Inter","Segoe UI",system-ui,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans CJK SC",sans-serif;
<pclass="lede">magpie gives every agent every model. Add a provider once — DeepSeek, Kimi, GLM, Qwen, OpenRouter, Ollama, or the Claude and ChatGPT plans you already pay for — and pick it from Codex, Claude Code, Gemini CLI or any other agent, in one click.</p>
<pclass="lede"data-i18n="hero.lede">magpie gives every agent every model. Add a provider once — DeepSeek, Kimi, GLM, Qwen, OpenRouter, Ollama, or the Claude and ChatGPT plans you already pay for — and pick it from Codex, Claude Code, Gemini CLI or any other agent, in one click.</p>
<imgloading="lazy"class="pick for-light"src="/img/picker-light.png"width="440"height="555"alt="Codex's model picker in magpie, listing DeepSeek, Kimi and GLM models">
<imgloading="lazy"class="pick for-dark"src="/img/picker-dark.png"width="440"height="555"alt="Codex's model picker in magpie, listing DeepSeek, Kimi and GLM models">
<imgloading="lazy"class="pick for-light"src="/img/picker-light.png"width="440"height="555"data-i18n-attr="alt:alt.picker"alt="Codex's model picker in magpie, listing DeepSeek, Kimi and GLM models">
<imgloading="lazy"class="pick for-dark"src="/img/picker-dark.png"width="440"height="555"data-i18n-attr="alt:alt.picker"alt="Codex's model picker in magpie, listing DeepSeek, Kimi and GLM models">
<pclass="sub">Codex only speaks OpenAI Responses. Claude Code only speaks Anthropic Messages. magpie runs a gateway on your machine that speaks all of them and translates in both directions — streaming, tool calls and reasoning included — so any agent can use any vendor’s model.</p>
<pclass="eyebrow"data-i18n="how.eyebrow">How it works</p>
<h2data-i18n="how.h2">One gateway speaks every API.</h2>
<pclass="sub"data-i18n="how.sub">Codex only speaks OpenAI Responses. Claude Code only speaks Anthropic Messages. magpie runs a gateway on your machine that speaks all of them and translates in both directions — streaming, tool calls and reasoning included — so any agent can use any vendor’s model.</p>
<imgclass="for-light"loading="lazy"src="/img/panel-light.png"width="440"height="470"alt="The magpie menu bar panel: each agent on a different vendor's model">
<imgclass="for-dark"loading="lazy"src="/img/panel-dark.png"width="440"height="470"alt="The magpie menu bar panel: each agent on a different vendor's model">
<imgclass="for-light"loading="lazy"src="/img/panel-light.png"width="440"height="470"data-i18n-attr="alt:alt.panel"alt="The magpie menu bar panel: each agent on a different vendor's model">
<imgclass="for-dark"loading="lazy"src="/img/panel-dark.png"width="440"height="470"data-i18n-attr="alt:alt.panel"alt="The magpie menu bar panel: each agent on a different vendor's model">
</div>
<div>
<pclass="eyebrow">The menu bar</p>
<h2>Every agent, its own model.</h2>
<pclass="sub">One glance shows what each agent runs. Click a value to change it; magpie rewrites that agent’s config — only the key you changed — and the next session uses it.</p>
<pclass="eyebrow"data-i18n="bar.eyebrow">The menu bar</p>
<h2data-i18n="bar.h2">Every agent, its own model.</h2>
<pclass="sub"data-i18n="bar.sub">One glance shows what each agent runs. Click a value to change it; magpie rewrites that agent’s config — only the key you changed — and the next session uses it.</p>
<ul>
<li><b>Codex</b> gets DeepSeek in its own <code>/model</code> list, with the right reasoning efforts.</li>
<li><b>Claude Code</b> gets Kimi, GLM or GPT behind <code>opus</code>, <code>sonnet</code> and <code>haiku</code>.</li>
<li><b>Pick the native model</b> and magpie puts back exactly what was there before.</li>
<li><b>Profiles</b> switch every agent at once — “Budget”, “Focus”, whatever you save.</li>
<lidata-i18n="bar.l1"><b>Codex</b> gets DeepSeek in its own <code>/model</code> list, with the right reasoning efforts.</li>
<lidata-i18n="bar.l2"><b>Claude Code</b> gets Kimi, GLM or GPT behind <code>opus</code>, <code>sonnet</code> and <code>haiku</code>.</li>
<lidata-i18n="bar.l3"><b>Pick the native model</b> and magpie puts back exactly what was there before.</li>
<lidata-i18n="bar.l4"><b>Profiles</b> switch every agent at once — “Budget”, “Focus”, whatever you save.</li>
</ul>
</div>
</div>
</section>
<sectionid="subscriptions">
<pclass="eyebrow">Subscriptions, shared</p>
<h2>The plans you pay for, in every agent.</h2>
<pclass="sub">Signed in to an agent? That login becomes a provider. Its models show up in every other agent’s picker — nothing copied, no key to paste, tokens refreshed the way the agent does it.</p>
<h2data-i18n="subs.h2">The plans you pay for, in every agent.</h2>
<pclass="sub"data-i18n="subs.sub">Signed in to an agent? That login becomes a provider. Its models show up in every other agent’s picker — nothing copied, no key to paste, tokens refreshed the way the agent does it.</p>
<divclass="subs">
<div><divclass="who"><imgsrc="/icons/claude-color.svg"alt="">Claude Pro / Max</div><p>Your Claude Code sign-in powers OpenCode, Pi or Goose: <code>claude/claude-sonnet-5</code>.</p></div>
<div><divclass="who"><imgclass="bird"src="/icons/openai.svg"alt="">ChatGPT Plus / Pro</div><p>Your Codex sign-in puts GPT in Claude Code: <code>codex/gpt-5.5</code>.</p></div>
<div><divclass="who"><imgclass="bird"src="/icons/githubcopilot.svg"alt="">GitHub Copilot</div><p>Your Copilot seat serves any agent: <code>copilot/claude-sonnet-4.5</code>.</p></div>
<div><divclass="who"><imgsrc="/icons/claude-color.svg"alt="">Claude Pro / Max</div><pdata-i18n="subs.claude">Your Claude Code sign-in powers OpenCode, Pi or Goose: <code>claude/claude-sonnet-5</code>.</p></div>
<div><divclass="who"><imgclass="bird"src="/icons/openai.svg"alt="">ChatGPT Plus / Pro</div><pdata-i18n="subs.codex">Your Codex sign-in puts GPT in Claude Code: <code>codex/gpt-5.5</code>.</p></div>
<div><divclass="who"><imgclass="bird"src="/icons/githubcopilot.svg"alt="">GitHub Copilot</div><pdata-i18n="subs.copilot">Your Copilot seat serves any agent: <code>copilot/claude-sonnet-4.5</code>.</p></div>
</div>
</section>
<sectionid="routing">
<pclass="eyebrow">Smart routing</p>
<h2>The right model for each turn. It never runs dry.</h2>
<pclass="sub">Say what each model is for — "a quick question", "writing or fixing tests" — and as each turn begins a small, fast model tells magpie which it is: the turn goes to that model, and its tool rounds stay there. <ahref="/docs/intent">How it works</a>. And add every key and subscription you have — several Claude, ChatGPT, Copilot or Grok accounts, several keys for one vendor — and turn them all on. For each request magpie picks the account that should answer, and when one can't, the next answers before your agent ever sees an error.</p>
<h2data-i18n="rt.h2">The right model for each turn. It never runs dry.</h2>
<pclass="sub"data-i18n="rt.sub">Say what each model is for — "a quick question", "writing or fixing tests" — and as each turn begins a small, fast model tells magpie which it is: the turn goes to that model, and its tool rounds stay there. <ahref="/docs/intent">How it works</a>. And add every key and subscription you have — several Claude, ChatGPT, Copilot or Grok accounts, several keys for one vendor — and turn them all on. For each request magpie picks the account that should answer, and when one can't, the next answers before your agent ever sees an error.</p>
<buttonrole="tab"data-mode="least"aria-selected="false"data-i18n="rt.least">Least used first</button>
</div>
<pclass="rt-mode">Smart, the default: the account that resets soonest goes first, so no allowance is left to go to waste; any that can't answer are passed over. (Here each request stands for an hour.)</p>
<pclass="rt-mode"data-i18n="rt.mode.smart">Smart, the default: the account that resets soonest goes first, so no allowance is left to go to waste; any that can't answer are passed over. (Here each request stands for an hour.)</p>
<li><iclass="dot"></i><b><imgsrc="/icons/claude-color.svg"alt="">me@home.dev <span>Claude Pro</span></b><em>38% used · resets in 2 d</em><divclass="bar"><istyle="width:38%"></i></div><spanclass="tag"></span></li>
<pclass="rt-cap"aria-live="polite">Claude Code sends every request to magpie; magpie decides which account answers it.</p>
<divclass="rt-stats"><span><b>0</b>requests</span><span><b>0</b>rerouted</span><span><b>0</b>errors your agent saw</span></div>
<pclass="rt-cap"aria-live="polite"data-i18n="rt.cap">Claude Code sends every request to magpie; magpie decides which account answers it.</p>
<divclass="rt-stats"><span><b>0</b><spandata-i18n="rt.s1">requests</span></span><span><b>0</b><spandata-i18n="rt.s2">rerouted</span></span><span><b>0</b><spandata-i18n="rt.s3">errors your agent saw</span></span></div>
</div>
</div>
<divclass="grid rt-points">
<div><h3>Reset-aware</h3><p>The account that resets soonest goes first — what it has left would be lost at the reset. It keeps the requests while it has quota to spare, so its prompt cache stays warm.</p></div>
<div><h3>Out of credit</h3><p>A key whose balance ran out sits out half an hour; requests go to one that can still pay.</p></div>
<div><h3>Rate limits & quotas</h3><p>An account the vendor has limited is passed over for as long as the vendor asks — its Retry-After and reset headers, no guessing, no hammering.</p></div>
<div><h3>Failover</h3><p>A failing account steps back a minute, longer each time it fails again; the request is retried on the next before a byte of the reply reaches your agent.</p></div>
<div><h3data-i18n="rt.reset">Reset-aware</h3><pdata-i18n="rt.reset.p">The account that resets soonest goes first — what it has left would be lost at the reset. It keeps the requests while it has quota to spare, so its prompt cache stays warm.</p></div>
<div><h3data-i18n="rt.credit">Out of credit</h3><pdata-i18n="rt.credit.p">A key whose balance ran out sits out half an hour; requests go to one that can still pay.</p></div>
<div><h3data-i18n="rt.limits">Rate limits & quotas</h3><pdata-i18n="rt.limits.p">An account the vendor has limited is passed over for as long as the vendor asks — its Retry-After and reset headers, no guessing, no hammering.</p></div>
<div><h3data-i18n="rt.failover">Failover</h3><pdata-i18n="rt.failover.p">A failing account steps back a minute, longer each time it fails again; the request is retried on the next before a byte of the reply reaches your agent.</p></div>
</div>
</section>
<sectionid="providers">
<pclass="eyebrow">Providers</p>
<h2>Paste a key. That’s the setup.</h2>
<pclass="sub">Twenty presets — vendors, relays and local servers. magpie asks each vendor which models it serves, so a model released this morning is in every picker on the next refresh. Keys stay in magpie; agents never see them.</p>
<h2data-i18n="prov.h2">Paste a key. That’s the setup.</h2>
<pclass="sub"data-i18n="prov.sub">Twenty presets — vendors, relays and local servers. magpie asks each vendor which models it serves, so a model released this morning is in every picker on the next refresh. Keys stay in magpie; agents never see them.</p>
<divclass="wide">
<imgclass="for-light"loading="lazy"src="/img/providers-light.png"width="1040"height="507"alt="magpie's Providers tab: DeepSeek, Kimi, GLM, Qwen, MiniMax, OpenRouter, Anthropic and Gemini, each with the agents using it">
<imgclass="for-dark"loading="lazy"src="/img/providers-dark.png"width="1040"height="507"alt="magpie's Providers tab: DeepSeek, Kimi, GLM, Qwen, MiniMax, OpenRouter, Anthropic and Gemini, each with the agents using it">
<imgclass="for-light"loading="lazy"src="/img/providers-light.png"width="1040"height="507"data-i18n-attr="alt:alt.providers"alt="magpie's Providers tab: DeepSeek, Kimi, GLM, Qwen, MiniMax, OpenRouter, Anthropic and Gemini, each with the agents using it">
<imgclass="for-dark"loading="lazy"src="/img/providers-dark.png"width="1040"height="507"data-i18n-attr="alt:alt.providers"alt="magpie's Providers tab: DeepSeek, Kimi, GLM, Qwen, MiniMax, OpenRouter, Anthropic and Gemini, each with the agents using it">
<h2data-i18n="det.h2">Small, careful, and out of the way.</h2>
<divclass="grid"style="margin-top:32px">
<div><h3>Surgical config edits</h3><p>Comments, ordering and indentation in <code>settings.json</code>, <code>config.toml</code> or <code>config.yaml</code> survive. Writes are atomic.</p></div>
<div><h3>Tiny, native, open</h3><p>Under 15 MB, on the system webview. No Electron, no runtime. MIT-licensed, <ahref="https://github.com/yetone/magpie">on GitHub</a>.</p></div>
<div><h3>No keys from your shell</h3><p>magpie never reads API keys from environment variables. What you add is what it uses.</p></div>
<div><h3>Any gateway client</h3><p>Anything with a base-URL setting can use it: <code>OPENAI_BASE_URL</code>, <code>ANTHROPIC_BASE_URL</code>, <code>GOOGLE_GEMINI_BASE_URL</code>.</p></div>
<div><h3>Usage, per agent</h3><p>Tokens, cache hits and cost for each agent and model that went through the gateway.</p></div>
<div><h3>Updates itself</h3><p>New versions download quietly and install when you restart. Signed and notarised on the Mac.</p></div>
<div><h3data-i18n="det.edits">Surgical config edits</h3><pdata-i18n="det.edits.p">Comments, ordering and indentation in <code>settings.json</code>, <code>config.toml</code> or <code>config.yaml</code> survive. Writes are atomic.</p></div>
<div><h3data-i18n="det.tiny">Tiny, native, open</h3><pdata-i18n="det.tiny.p">Under 15 MB, on the system webview. No Electron, no runtime. MIT-licensed, <ahref="https://github.com/yetone/magpie">on GitHub</a>.</p></div>
<div><h3data-i18n="det.env">No keys from your shell</h3><pdata-i18n="det.env.p">magpie never reads API keys from environment variables. What you add is what it uses.</p></div>
<div><h3data-i18n="det.client">Any gateway client</h3><pdata-i18n="det.client.p">Anything with a base-URL setting can use it: <code>OPENAI_BASE_URL</code>, <code>ANTHROPIC_BASE_URL</code>, <code>GOOGLE_GEMINI_BASE_URL</code>.</p></div>
<div><h3data-i18n="det.usage">Usage, per agent</h3><pdata-i18n="det.usage.p">Tokens, cache hits and cost for each agent and model that went through the gateway.</p></div>
<div><h3data-i18n="det.update">Updates itself</h3><pdata-i18n="det.update.p">New versions download quietly and install when you restart. Signed and notarised on the Mac.</p></div>
</div>
</section>
<sectionid="cli">
<pclass="eyebrow">Terminal</p>
<h2>Also a TUI and a CLI.</h2>
<pclass="sub">The same app, from a terminal. The installer puts the <code>magpie</code> command in <code>~/.local/bin</code> and the app where it belongs: <code>/Applications</code> on a Mac, your app menu on Linux.</p>
<pclass="meta"style="margin:12px 0 28px">On Windows, <code>magpie.exe</code> takes the same commands; <code>magpie-cli-windows-amd64.exe</code> from the <ahref="https://github.com/yetone/magpie-releases/releases/latest">latest release</a> is the terminal-only build.</p>
<pre><spanclass="c"># add providers</span>
magpie provider add deepseek sk-… <spanclass="c"># a preset needs only the key</span>
<pclass="sub"data-i18n="cli.sub">The same app, from a terminal. The installer puts the <code>magpie</code> command in <code>~/.local/bin</code> and the app where it belongs: <code>/Applications</code> on a Mac, your app menu on Linux.</p>
<pclass="meta"style="margin:12px 0 28px"data-i18n="cli.win">On Windows, <code>magpie.exe</code> takes the same commands; <code>magpie-cli-windows-amd64.exe</code> from the <ahref="https://github.com/yetone/magpie-releases/releases/latest">latest release</a> is the terminal-only build.</p>
<div><b>Join the magpie community</b><span>Ask questions, share your setup, tell us what to build next — on Discord.</span></div>
<div><bdata-i18n="comm.h">Join the magpie community</b><spandata-i18n="comm.p">Ask questions, share your setup, tell us what to build next — on Discord.</span></div>
<iaria-hidden="true">→</i>
</a>
</aside>
<divclass="final">
<imgclass="bird"src="/img/magpie.svg"alt="">
<h2>Every agent. Every model.</h2>
<pclass="sub"style="margin:0 auto 32px">Free, open source, native. For macOS, Windows and Linux.</p>
<div><b>macOS</b><span>11 or later</span><ahref="/download/mac-arm64">Apple Silicon</a><ahref="/download/mac-intel">Intel</a></div>
<div><b>Windows</b><span>10 or later</span><ahref="/download/windows-amd64">x64</a><ahref="/download/windows-arm64">ARM</a></div>
<div><b>macOS</b><spandata-i18n="plat.mac">11 or later</span><ahref="/download/mac-arm64">Apple Silicon</a><ahref="/download/mac-intel">Intel</a></div>
<div><b>Windows</b><spandata-i18n="plat.win">10 or later</span><ahref="/download/windows-amd64">x64</a><ahref="/download/windows-arm64">ARM</a></div>
name:"By intent",n:0,stats:["turns","asked the classifier","tool rounds kept on their model"],
desc:"By intent: as a turn begins, a small fast model (the group's classifier) is asked once which of your rules' intents the message is. The turn goes to that rule's model; its tool rounds stay there, without asking again.",
name:T("By intent","按意图"),n:0,stats:T(["turns","asked the classifier","tool rounds kept on their model"],["轮对话","次询问分类模型","个工具轮次留在原模型"]),
desc:T("By intent: as a turn begins, a small fast model (the group's classifier) is asked once which of your rules' intents the message is. The turn goes to that rule's model; its tool rounds stay there, without asking again.",
G("claude-opus-5-5","Claude Max","claude-color","","first · whatever no rule takes"),
G("deepseek-v4-flash","DeepSeek","deepseek-color","","intent · a quick question","quick question"),
G("glm-5.3","Zhipu GLM","zhipu-color","","intent · writing or fixing tests","tests"),
G("kimi-k3","Kimi","kimi","bird","intent · reviewing a diff","review"),
G("claude-opus-5-5","Claude Max","claude-color","",T("first · whatever no rule takes","第一个 · 规则都不匹配时用它")),
G("deepseek-v4-flash","DeepSeek","deepseek-color","",T("intent · a quick question","意图 · 简单提问"),T("quick question","简单提问")),
G("glm-5.3",T("Zhipu GLM","智谱 GLM"),"zhipu-color","",T("intent · writing or fixing tests","意图 · 编写或修复测试"),T("tests","测试")),
G("kimi-k3","Kimi","kimi","bird",T("intent · reviewing a diff","意图 · 审阅改动"),T("review","审阅")),
],
turns:[
["Add a --dry-run flag to the deploy command",0,2],
["What does ^\\d{3}-\\d{4}$ match?",1,0],
["TestRouting fails after my change — fix it",2,2],
["Review my staged changes before I commit",3,1],
["Why does useEffect run twice in dev?",1,0],
["Write table-driven tests for parseTokens",2,1],
["Refactor the retry loop into its own function",0,1],
[T("Add a --dry-run flag to the deploy command","给 deploy 命令加一个 --dry-run 参数"),0,2],
[T("What does ^\\d{3}-\\d{4}$ match?","^\\d{3}-\\d{4}$ 能匹配什么?"),1,0],
[T("TestRouting fails after my change — fix it","我改完之后 TestRouting 挂了,帮我修好"),2,2],
[T("Review my staged changes before I commit","提交前帮我审一下暂存的改动"),3,1],
[T("Why does useEffect run twice in dev?","为什么 useEffect 在开发模式下会执行两次?"),1,0],
[T("Write table-driven tests for parseTokens","给 parseTokens 写表驱动测试"),2,1],
[T("Refactor the retry loop into its own function","把重试循环抽成单独的函数"),0,1],
],
},
smart:{
name:"Smart",n:30,
desc:"Smart, the default: the account that resets soonest goes first, so no allowance is left to go to waste; any that can't answer are passed over. (Here each request stands for an hour.)",
first:(a)=>`${a.name} resets in ${fmt(left(a))} — soonest, so it goes first: what it has left is used, not lost at the reset.`,
name:T("Smart","智能"),n:30,
desc:T("Smart, the default: the account that resets soonest goes first, so no allowance is left to go to waste; any that can't answer are passed over. (Here each request stands for an hour.)",
desc:"Least used first: each request goes to the account with the most allowance left; a key by the tokens magpie sent it lately.",
first:()=>"Each request goes to whichever has the most left — watch the bars even out.",
name:T("Least used","用量少的优先"),n:18,
desc:T("Least used first: each request goes to the account with the most allowance left; a key by the tokens magpie sent it lately.","用量少的优先:每个请求交给剩余额度最多的账号;密钥按 magpie 最近发给它的 token 数算。"),
first:()=>T("Each request goes to whichever has the most left — watch the bars even out.","每个请求交给剩得最多的账号——看进度条慢慢拉平。"),
show(M.turns?"Claude Code sends every turn to one model name — a magpie group. Watch where each message goes.":"Claude Code sends every request to magpie; magpie decides which account answers it.");
show(M.turns?T("Claude Code sends every turn to one model name — a magpie group. Watch where each message goes.","Claude Code 每轮都发给同一个模型名——一个 magpie 路由组。看每条消息去了哪里。")
:T("Claude Code sends every request to magpie; magpie decides which account answers it.","Claude Code 把每个请求发给 magpie,由 magpie 决定哪个账号来答。"));
stats();render();
}
@@ -850,23 +906,24 @@ magpie tui <span class="c"># the whole app, in the t
a.served++;a.used=Math.min(100,a.used+a.inc);
if(last!==a){
if(!began)began=1,say(M.first(a));
elseif(mode==="smart"&&a.used>=90)say(`The others are resting, so ${a.name.replace(/^The /,"the ")} answers — running low beats no answer.`);
elseif(mode==="smart"&&a.r)say(`${a.name} takes over — it resets next, in ${fmt(left(a))}.`,true);
if(mode==="smart"&&was<90&&a.used>=90)say(`${a.name} is at ${Math.round(a.used)}% — kept for last. The next with quota to spare takes over.`);
if(mode==="smart"&&was<90&&a.used>=90)say(T(`${a.name} is at ${Math.round(a.used)}% — kept for last. The next with quota to spare takes over.`,`${a.name} 已用 ${Math.round(a.used)}%——留到最后。下一个额度充足的账号接手。`));
if(mode!=="smart")return;
hours++;
for(constbofaccts)if(b.r&&left(b)<=0){// its week renews: now the last to reset
constlost=Math.round(100-b.used);
b.used=0;b.r+=168;
say(`${b.name}'s week renewed with only ${lost}% unused — it went first, so little was lost. It resets last now; the next to reset takes over.`);
say(T(`${b.name}'s week renewed with only ${lost}% unused — it went first, so little was lost. It resets last now; the next to reset takes over.`,`${b.name} 的周额度已重置,只剩 ${lost}% 没用上——它先用,所以几乎没浪费。现在它最晚重置,下一个要重置的账号接手。`));
if(last===b)last=null;
}
}
constTAGS={429:"429 · rate limited",402:"402 · no credit",503:"503 · failed",quota:"429 · quota used up"};
constTAGS=T({429:"429 · rate limited",402:"402 · no credit",503:"503 · failed",quota:"429 · quota used up"},
@@ -874,10 +931,10 @@ magpie tui <span class="c"># the whole app, in the t
if(resting(a))return;// it was already out when the request got there
a.code=code;
next=Math.max(next,t+1500);// a moment to read what happened
if(code===429){a.why="rate";a.until=t+a.fail.rest;say(`${a.name} answered 429 — it rests for as long as the vendor asks, and the request is retried on the next at once.`);}
if(code===402){a.why="credit";a.until=Infinity;say(`${a.name} is out of credit — it sits out half an hour, and the request moves on. Claude Code never sees the error.`);}
if(code===503){a.why="fail";a.until=t+a.fail.rest;say(`${a.name} failed — it steps back a while, longer each time it fails again. Another account answers instead.`);}
if(code==="quota"){a.why="quota";a.until=Infinity;say(`${a.name} is out of quota — passed over until it resets. The request goes to the next.`);}
if(code===429){a.why="rate";a.until=t+a.fail.rest;say(T(`${a.name} answered 429 — it rests for as long as the vendor asks, and the request is retried on the next at once.`,`${a.name} 返回 429——按厂商要求的时长休息,请求立刻在下一个账号上重试。`));}
if(code===402){a.why="credit";a.until=Infinity;say(T(`${a.name} is out of credit — it sits out half an hour, and the request moves on. Claude Code never sees the error.`,`${a.name} 余额不足——歇半小时,请求转给别的账号。Claude Code 完全看不到这个错误。`));}
if(code===503){a.why="fail";a.until=t+a.fail.rest;say(T(`${a.name} failed — it steps back a while, longer each time it fails again. Another account answers instead.`,`${a.name} 出错了——先退下一会儿,再出错就退得更久。换另一个账号来答。`));}
if(code==="quota"){a.why="quota";a.until=Infinity;say(T(`${a.name} is out of quota — passed over until it resets. The request goes to the next.`,`${a.name} 额度用完——重置前都跳过它,请求交给下一个。`));}
if(last===a)last=null;
}
@@ -930,19 +987,21 @@ magpie tui <span class="c"># the whole app, in the t
show(n?`The classifier says: ${a.rule.replace("intent · ","")} — so ${a.who} answers it.`:`None of the intents — it goes to the group's first model, ${a.who}.`);
show(T(`${done} turns, each on the model its rule names — one question to the classifier per turn, ${errs} tool rounds kept on their model.`,`${done} 轮对话,各自交给规则指定的模型——每轮只问一次分类模型,${errs} 个工具轮次留在原模型。`));
awaitwait(4600);
if(g===gen)reset(mode);
}
@@ -980,11 +1039,12 @@ magpie tui <span class="c"># the whole app, in the t
?{rate:`rate limited · back in ${s} s`,fail:`failing · back in ${s} s`,credit:"out of credit · back in 30 m",quota:"out of quota · resets 3 PM"}[a.why]
say(`${a.name} is back — ${a.why==="rate"?"its rate limit is over":"it gets another chance"}.`,true);
say(T(`${a.name} is back — ${a.why==="rate"?"its rate limit is over":"it gets another chance"}.`,`${a.name} 回来了——${a.why==="rate"?"限流结束":"再给它一次机会"}。`),true);
capQ=[];show(`${done} requests answered, ${rerouted} rerouted — and not one error reached Claude Code.`);
capQ=[];show(T(`${done} requests answered, ${rerouted} rerouted — and not one error reached Claude Code.`,`${done} 个请求全部答完,${rerouted} 次改道——没有一个错误传到 Claude Code。`));
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.