Plain wording for the held-compaction error and the account-switch hint (ccw1942796 on X)

The error magpie gives Codex when a conversation's compaction has failed 3
times now says what happened, how long magpie waits and what to do:
"Couldn't compact the conversation: <model> failed N times in a row (last:
<vendor's reason>). magpie waits <t> before asking it again. To compact now,
switch this conversation to another model." It is a 400 back to Codex
(codexCompact), never sent upstream as prompt.

The hover hint beside "Switch {agent}'s account automatically" is two short
lines per agent instead of three long ones, in en, zh, zh-TW, ja and de.
It still says it is the agent's own sign-in that moves, that the agent sends
the requests, and that sharing an account is against the vendor's terms.

Run on mote: gofmt -l, go vet (darwin, linux, windows) on internal/gateway,
go test -run Compact ./internal/gateway, and in chromium and webkit
i18n-keys, i18n-en-no-cjk, keep-login, pool-ends, sign-in-moves (84 of 84
GUI subtests ok, en and zh). The hold test now asserts the new wording.

Not run: the full suite before the tag (started after it); ja, de and zh-TW
screenshots of the hint; breaking the new assertion by hand (the old text
lacks the asserted words).
This commit is contained in:
yetone
2026-11-12 16:37:49 +08:00
parent 1b884225ad
commit 19a698d0f9
5 changed files with 26 additions and 38 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ func (f *compactFails) held(key, model string) (string, bool) {
return "", false
}
left := (compactHeldFor - time.Since(c.last)).Round(time.Second)
return fmt.Sprintf("compaction: %s failed to summarise this conversation %d times in a row (last: %s); magpie doesn't ask it again for %s, so a compaction that can't succeed isn't paid for over and over. Pick another model for this conversation, or a group whose compaction rule sends it to one that answers",
return fmt.Sprintf("Couldn't compact the conversation: %s failed %d times in a row (last: %s). magpie waits %s before asking it again. To compact now, switch this conversation to another model.",
model, c.n, c.why, left), true
}
+1 -1
View File
@@ -180,7 +180,7 @@ func TestCodexCompactKeepsFailingIsHeld(t *testing.T) {
}
asked := f.calls
rec := codexPostTo(s, codexCompactOf("fake/m1", "thread-1"))
if rec.Code != 400 || !strings.Contains(rec.Body.String(), "3 times in a row") {
if rec.Code != 400 || !strings.Contains(rec.Body.String(), "Couldn't compact the conversation: fake/m1 failed 3 times in a row") || !strings.Contains(rec.Body.String(), "switch this conversation to another model") {
t.Fatalf("held: %d %s", rec.Code, rec.Body)
}
if f.calls != asked {
+4 -6
View File
@@ -15,12 +15,10 @@ window.autoSwitchTip = function (box, head, p) {
if (!m || !(m.mode === "moves" || m.mode === "kept" && !m.routed) || box.querySelector(":scope > .hint")) return;
const codex = p.account?.agent === "codex";
const lines = codex
? [t("magpie writes the next account's sign-in to Codex's own auth.json, as codex login does, and reads what is left where Codex's /status reads it. Sessions already open keep their account until they are restarted."),
t("It changes which of your own accounts Codex is signed in to, and nothing else: the requests are the ones Codex makes."),
t("So it is the same as switching accounts by hand. Use only accounts that are yours: sharing one is against OpenAI's terms.")]
: [t("magpie writes the next account's sign-in where Claude Code keeps its own, as /login does, and reads what is left by running Claude Code's own /usage. Sessions already open keep their account until they are restarted."),
t("Claude Code itself still sends every request, straight to Anthropic and unchanged; magpie sends none of them. An account with its own proxy keeps it."),
t("So it is the same as switching accounts by hand. Use only accounts that are yours: sharing one is against Anthropic's terms.")];
? [t("When the account runs low, magpie signs Codex in to your next account, as codex login does. Sessions already open keep their account until they are restarted."),
t("Requests still come from Codex itself. Use only accounts that are yours: sharing one is against OpenAI's terms.")]
: [t("When the account runs low, magpie signs Claude Code in to your next account, as /login does. Sessions already open keep their account until they are restarted."),
t("Requests still go from Claude Code straight to Anthropic, unchanged. Use only accounts that are yours: sharing one is against Anthropic's terms.")];
box.classList.add("hint-row");
box.append(...lines.map((s) => el("p", "hint", s)));
const mark = el("span", "as-tip");
+16 -24
View File
@@ -2104,12 +2104,10 @@ const I18N = {
"Routing picks the account for each request through magpie; {agent} on its own uses the one it is signed in to, which magpie moves to the next ticked account with room once it is 98% used, and back to the first once that has room again.": "经 magpie 的请求由路由挑选账号;{agent} 直连时用它登录的账号,该账号用到 98% 时,magpie 把 {agent} 登录到下一个已勾选且有余量的账号,首选账号恢复后切回。",
"Routing picks the account for each request through magpie; {agent} on its own uses the one it is signed in to, which magpie moves to the next ticked account with room once it is 98% used, and keeps it there till that one is 98% used too.": "经 magpie 的请求由路由挑选账号;{agent} 直连时用它登录的账号,该账号用到 98% 时,magpie 把 {agent} 登录到下一个已勾选且有余量的账号,并一直用它,直到它也用到 98%。",
"Switch {agent}'s account automatically": "自动切换 {agent} 的账号",
"magpie writes the next account's sign-in to Codex's own auth.json, as codex login does, and reads what is left where Codex's /status reads it. Sessions already open keep their account until they are restarted.": "magpie 把下一个账号的登录写进 Codex 自己的 auth.json,和 codex login 一样;剩余额度从 Codex 的 /status 读取的同一处读取。已经打开的会话继续用原来的账号,直到重新启动。",
"It changes which of your own accounts Codex is signed in to, and nothing else: the requests are the ones Codex makes.": "它只改变 Codex 登录的是你自己的哪一个账号,别的都不动:请求仍是 Codex 自己发出的那些。",
"So it is the same as switching accounts by hand. Use only accounts that are yours: sharing one is against OpenAI's terms.": "所以这和你手动切换账号是一样的。请只用你自己的账号:共享账号违反 OpenAI 的条款。",
"magpie writes the next account's sign-in where Claude Code keeps its own, as /login does, and reads what is left by running Claude Code's own /usage. Sessions already open keep their account until they are restarted.": "magpie 把下一个账号的登录写到 Claude Code 自己保存登录的地方,和 /login 一样;剩余额度通过运行 Claude Code 自己的 /usage 读取。已经打开的会话继续用原来的账号,直到重新启动。",
"Claude Code itself still sends every request, straight to Anthropic and unchanged; magpie sends none of them. An account with its own proxy keeps it.": "每个请求仍由 Claude Code 本身发出,直接发往 Anthropic,原样不改;magpie 一个都不发。设了自己代理的账号继续走它的代理。",
"So it is the same as switching accounts by hand. Use only accounts that are yours: sharing one is against Anthropic's terms.": "所以这和你手动切换账号是一样的。请只用你自己的账号:共享账号违反 Anthropic 的条款。",
"When the account runs low, magpie signs Codex in to your next account, as codex login does. Sessions already open keep their account until they are restarted.": "账号额度快用完时,magpie 把 Codex 登录到你的下一个账号,和 codex login 一样。已经打开的会话继续用原来的账号,直到重新启动。",
"Requests still come from Codex itself. Use only accounts that are yours: sharing one is against OpenAI's terms.": "请求仍由 Codex 自己发出。请只用你自己的账号:共享账号违反 OpenAI 的条款。",
"When the account runs low, magpie signs Claude Code in to your next account, as /login does. Sessions already open keep their account until they are restarted.": "账号额度快用完时,magpie 把 Claude Code 登录到你的下一个账号,和 /login 一样。已经打开的会话继续用原来的账号,直到重新启动。",
"Requests still go from Claude Code straight to Anthropic, unchanged. Use only accounts that are yours: sharing one is against Anthropic's terms.": "请求仍由 Claude Code 直接发往 Anthropic,原样不改。请只用你自己的账号:共享账号违反 Anthropic 的条款。",
"Always on while magpie only switches {agent}'s sign-in": "{agent} 只切换登录时始终开启",
"{agent}'s requests go through magpie, which sends each one to an account with room; its own sign-in stays where you put it.": "{agent} 的请求经过 magpie,每个请求都发给有额度的账号;{agent} 自己的登录保持你选的账号不变。",
"When the account {agent} is signed in to is used up, magpie signs it in to the next ticked account with room.": "{agent} 登录的账号用完时,magpie 把它登录到下一个已勾选且有额度的账号。",
@@ -7221,12 +7219,10 @@ const I18N = {
"Routing picks the account for each request through magpie; {agent} on its own uses the one it is signed in to, which magpie moves to the next ticked account with room once it is 98% used, and back to the first once that has room again.": "經 magpie 的請求由路由挑選帳號;{agent} 直連時用它登入的帳號,該帳號用到 98% 時,magpie 把 {agent} 登入到下一個已勾選且有餘量的帳號,首選帳號恢復後切回。",
"Routing picks the account for each request through magpie; {agent} on its own uses the one it is signed in to, which magpie moves to the next ticked account with room once it is 98% used, and keeps it there till that one is 98% used too.": "經 magpie 的請求由路由挑選帳號;{agent} 直連時用它登入的帳號,該帳號用到 98% 時,magpie 把 {agent} 登入到下一個已勾選且有餘量的帳號,並一直用它,直到它也用到 98%。",
"Switch {agent}'s account automatically": "自動切換 {agent} 的帳號",
"magpie writes the next account's sign-in to Codex's own auth.json, as codex login does, and reads what is left where Codex's /status reads it. Sessions already open keep their account until they are restarted.": "magpie 把下一個帳號的登入寫進 Codex 自己的 auth.json,和 codex login 一樣;剩餘額度從 Codex 的 /status 讀取的同一處讀取。已經開啟的工作階段繼續用原來的帳號,直到重新啟動。",
"It changes which of your own accounts Codex is signed in to, and nothing else: the requests are the ones Codex makes.": "它只改變 Codex 登入的是你自己的哪一個帳號,其他都不動:請求仍是 Codex 自己發出的那些。",
"So it is the same as switching accounts by hand. Use only accounts that are yours: sharing one is against OpenAI's terms.": "所以這和你手動切換帳號是一樣的。請只用你自己的帳號:共用帳號違反 OpenAI 的條款。",
"magpie writes the next account's sign-in where Claude Code keeps its own, as /login does, and reads what is left by running Claude Code's own /usage. Sessions already open keep their account until they are restarted.": "magpie 把下一個帳號的登入寫到 Claude Code 自己保存登入的地方,和 /login 一樣;剩餘額度透過執行 Claude Code 自己的 /usage 讀取。已經開啟的工作階段繼續用原來的帳號,直到重新啟動。",
"Claude Code itself still sends every request, straight to Anthropic and unchanged; magpie sends none of them. An account with its own proxy keeps it.": "每個請求仍由 Claude Code 本身發出,直接送往 Anthropic,原封不動;magpie 一個都不送。設了自己代理的帳號繼續走它的代理。",
"So it is the same as switching accounts by hand. Use only accounts that are yours: sharing one is against Anthropic's terms.": "所以這和你手動切換帳號是一樣的。請只用你自己的帳號:共用帳號違反 Anthropic 的條款。",
"When the account runs low, magpie signs Codex in to your next account, as codex login does. Sessions already open keep their account until they are restarted.": "帳號額度快用完時,magpie 會把 Codex 登入到你的下一個帳號,和 codex login 一樣。已經開啟的工作階段會繼續使用原來的帳號,直到重新啟動。",
"Requests still come from Codex itself. Use only accounts that are yours: sharing one is against OpenAI's terms.": "請求仍由 Codex 自己發出。請只使用你自己的帳號:共用帳號違反 OpenAI 的條款。",
"When the account runs low, magpie signs Claude Code in to your next account, as /login does. Sessions already open keep their account until they are restarted.": "帳號額度快用完時,magpie 會把 Claude Code 登入到你的下一個帳號,和 /login 一樣。已經開啟的工作階段會繼續使用原來的帳號,直到重新啟動。",
"Requests still go from Claude Code straight to Anthropic, unchanged. Use only accounts that are yours: sharing one is against Anthropic's terms.": "請求仍由 Claude Code 直接送往 Anthropic,原樣不改。請只使用你自己的帳號:共用帳號違反 Anthropic 的條款。",
"Always on while magpie only switches {agent}'s sign-in": "{agent} 只切換登入時始終開啟",
"{agent}'s requests go through magpie, which sends each one to an account with room; its own sign-in stays where you put it.": "{agent} 的請求經過 magpie,每個請求都發給有額度的帳號;{agent} 自己的登入保持你選的帳號不變。",
"When the account {agent} is signed in to is used up, magpie signs it in to the next ticked account with room.": "{agent} 登入的帳號用完時,magpie 把它登入到下一個已勾選且有額度的帳號。",
@@ -12314,12 +12310,10 @@ const I18N = {
"Routing picks the account for each request through magpie; {agent} on its own uses the one it is signed in to, which magpie moves to the next ticked account with room once it is 98% used, and back to the first once that has room again.": "magpie 経由のリクエストはルーティングがアカウントを選びます。{agent} 単体ではサインイン中のアカウントを使い、そのアカウントが 98% 使用されると magpie が残量のある次のチェック済みアカウントに切り替え、最初のアカウントに残量が戻ると元に戻します。",
"Routing picks the account for each request through magpie; {agent} on its own uses the one it is signed in to, which magpie moves to the next ticked account with room once it is 98% used, and keeps it there till that one is 98% used too.": "magpie 経由のリクエストはルーティングがアカウントを選びます。{agent} 単体ではサインイン中のアカウントを使い、そのアカウントが 98% 使用されると magpie が残量のある次のチェック済みアカウントに切り替え、そのアカウントも 98% 使用されるまでそのまま使います。",
"Switch {agent}'s account automatically": "{agent} のアカウントを自動で切り替える",
"magpie writes the next account's sign-in to Codex's own auth.json, as codex login does, and reads what is left where Codex's /status reads it. Sessions already open keep their account until they are restarted.": "magpie は次のアカウントのサインインを Codex 自身の auth.json に書き込みます(codex login と同じです)。残りは Codex の /status が読むのと同じところから読みます。開いているセッションは再起動するまで元のアカウントのままです。",
"It changes which of your own accounts Codex is signed in to, and nothing else: the requests are the ones Codex makes.": "変わるのは Codex がサインインしている自分のアカウントだけで、ほかは何も変えません。リクエストは Codex 自身が送るものです。",
"So it is the same as switching accounts by hand. Use only accounts that are yours: sharing one is against OpenAI's terms.": "つまり手でアカウントを切り替えるのと同じです。自分のアカウントだけを使ってください。アカウントの共有は OpenAI の規約に反します。",
"magpie writes the next account's sign-in where Claude Code keeps its own, as /login does, and reads what is left by running Claude Code's own /usage. Sessions already open keep their account until they are restarted.": "magpie は次のアカウントのサインインを Claude Code が自分のサインインを保存する場所に書き込みます(/login と同じです)。残りは Claude Code 自身の /usage を実行して読みます。開いているセッションは再起動するまで元のアカウントのままです。",
"Claude Code itself still sends every request, straight to Anthropic and unchanged; magpie sends none of them. An account with its own proxy keeps it.": "リクエストはすべて Claude Code 自身が Anthropic へ直接、そのまま送ります。magpie は一つも送りません。独自のプロキシを持つアカウントはそのプロキシを使い続けます。",
"So it is the same as switching accounts by hand. Use only accounts that are yours: sharing one is against Anthropic's terms.": "つまり手でアカウントを切り替えるのと同じです。自分のアカウントだけを使ってください。アカウントの共有は Anthropic の規約に反します。",
"When the account runs low, magpie signs Codex in to your next account, as codex login does. Sessions already open keep their account until they are restarted.": "アカウントの残りが少なくなると、magpie は codex login と同じように Codex を次のアカウントにサインインさせます。すでに開いているセッションは、再起動するまで元のアカウントを使い続けます。",
"Requests still come from Codex itself. Use only accounts that are yours: sharing one is against OpenAI's terms.": "リクエストはこれまでどおり Codex 自身が送ります。ご自身のアカウントだけを使ってください。アカウントの共有は OpenAI の規約に反します。",
"When the account runs low, magpie signs Claude Code in to your next account, as /login does. Sessions already open keep their account until they are restarted.": "アカウントの残りが少なくなると、magpie は /login と同じように Claude Code を次のアカウントにサインインさせます。すでに開いているセッションは、再起動するまで元のアカウントを使い続けます。",
"Requests still go from Claude Code straight to Anthropic, unchanged. Use only accounts that are yours: sharing one is against Anthropic's terms.": "リクエストはこれまでどおり Claude Code から Anthropic へそのまま直接送られます。ご自身のアカウントだけを使ってください。アカウントの共有は Anthropic の規約に反します。",
"Always on while magpie only switches {agent}'s sign-in": "{agent} のサインインだけを切り替えるときは常にオン",
"{agent}'s requests go through magpie, which sends each one to an account with room; its own sign-in stays where you put it.": "{agent} のリクエストは magpie を経由し、各リクエストは残量のあるアカウントに送られます。そのサインインは選んだアカウントのままです。",
"When the account {agent} is signed in to is used up, magpie signs it in to the next ticked account with room.": "{agent} がサインインしているアカウントを使い切ると、magpie は残量のある次のチェック済みアカウントにサインインし直します。",
@@ -17438,12 +17432,10 @@ const I18N = {
"Routing picks the account for each request through magpie; {agent} on its own uses the one it is signed in to, which magpie moves to the next ticked account with room once it is 98% used, and back to the first once that has room again.": "Die Weiterleitung wählt für jede Anfrage über magpie das Konto; {agent} selbst nutzt das Konto, bei dem es angemeldet ist; magpie meldet es beim nächsten angehakten Konto mit freiem Kontingent an, sobald das aktuelle zu 98 % verbraucht ist, und wieder beim ersten, sobald dort wieder Kontingent frei ist.",
"Routing picks the account for each request through magpie; {agent} on its own uses the one it is signed in to, which magpie moves to the next ticked account with room once it is 98% used, and keeps it there till that one is 98% used too.": "Die Weiterleitung wählt für jede Anfrage über magpie das Konto; {agent} selbst nutzt das Konto, bei dem es angemeldet ist; magpie meldet es beim nächsten angehakten Konto mit freiem Kontingent an, sobald das aktuelle zu 98 % verbraucht ist, und bleibt dort, bis auch dieses zu 98 % verbraucht ist.",
"Switch {agent}'s account automatically": "{agent}-Konto automatisch wechseln",
"magpie writes the next account's sign-in to Codex's own auth.json, as codex login does, and reads what is left where Codex's /status reads it. Sessions already open keep their account until they are restarted.": "magpie schreibt die Anmeldung des nächsten Kontos in Codex' eigene auth.json, wie codex login es tut, und liest das Verbleibende dort, wo Codex' /status es liest. Bereits offene Sitzungen behalten ihr Konto, bis sie neu gestartet werden.",
"It changes which of your own accounts Codex is signed in to, and nothing else: the requests are the ones Codex makes.": "Es ändert nur, bei welchem deiner eigenen Konten Codex angemeldet ist, sonst nichts: Die Anfragen sind die, die Codex stellt.",
"So it is the same as switching accounts by hand. Use only accounts that are yours: sharing one is against OpenAI's terms.": "Es ist also dasselbe wie ein Kontowechsel von Hand. Nutze nur Konten, die dir gehören: Ein Konto zu teilen verstößt gegen die Bedingungen von OpenAI.",
"magpie writes the next account's sign-in where Claude Code keeps its own, as /login does, and reads what is left by running Claude Code's own /usage. Sessions already open keep their account until they are restarted.": "magpie schreibt die Anmeldung des nächsten Kontos dorthin, wo Claude Code seine eigene speichert, wie /login es tut, und liest das Verbleibende, indem es Claude Codes eigenes /usage ausführt. Bereits offene Sitzungen behalten ihr Konto, bis sie neu gestartet werden.",
"Claude Code itself still sends every request, straight to Anthropic and unchanged; magpie sends none of them. An account with its own proxy keeps it.": "Claude Code selbst sendet weiterhin jede Anfrage, direkt und unverändert an Anthropic; magpie sendet keine davon. Ein Konto mit eigenem Proxy behält ihn.",
"So it is the same as switching accounts by hand. Use only accounts that are yours: sharing one is against Anthropic's terms.": "Es ist also dasselbe wie ein Kontowechsel von Hand. Nutze nur Konten, die dir gehören: Ein Konto zu teilen verstößt gegen die Bedingungen von Anthropic.",
"When the account runs low, magpie signs Codex in to your next account, as codex login does. Sessions already open keep their account until they are restarted.": "Wird das Kontingent knapp, meldet magpie Codex an Ihrem nächsten Konto an, wie codex login. Bereits geöffnete Sitzungen behalten ihr Konto bis zum Neustart.",
"Requests still come from Codex itself. Use only accounts that are yours: sharing one is against OpenAI's terms.": "Die Anfragen sendet weiterhin Codex selbst. Verwenden Sie nur eigene Konten: Das Teilen eines Kontos verstößt gegen die Bedingungen von OpenAI.",
"When the account runs low, magpie signs Claude Code in to your next account, as /login does. Sessions already open keep their account until they are restarted.": "Wird das Kontingent knapp, meldet magpie Claude Code an Ihrem nächsten Konto an, wie /login. Bereits geöffnete Sitzungen behalten ihr Konto bis zum Neustart.",
"Requests still go from Claude Code straight to Anthropic, unchanged. Use only accounts that are yours: sharing one is against Anthropic's terms.": "Die Anfragen gehen weiterhin von Claude Code direkt und unverändert an Anthropic. Verwenden Sie nur eigene Konten: Das Teilen eines Kontos verstößt gegen die Bedingungen von Anthropic.",
"Always on while magpie only switches {agent}'s sign-in": "Immer an, solange magpie nur die Anmeldung von {agent} wechselt",
"{agent}'s requests go through magpie, which sends each one to an account with room; its own sign-in stays where you put it.": "Die Anfragen von {agent} laufen über magpie, das jede an ein Konto mit Kontingent schickt; die eigene Anmeldung bleibt, wo du sie gesetzt hast.",
"When the account {agent} is signed in to is used up, magpie signs it in to the next ticked account with room.": "Ist das Konto, bei dem {agent} angemeldet ist, aufgebraucht, meldet magpie es beim nächsten angehakten Konto mit Kontingent an.",
+4 -6
View File
@@ -68,9 +68,8 @@ const words = {
keep: "Keep Claude Code signed in to",
gateway: "Claude Code's requests go through magpie, which sends each one to an account with room; its own sign-in stays where you put it.",
tip: [
"magpie writes the next account's sign-in where Claude Code keeps its own, as /login does, and reads what is left by running Claude Code's own /usage. Sessions already open keep their account until they are restarted.",
"Claude Code itself still sends every request, straight to Anthropic and unchanged; magpie sends none of them. An account with its own proxy keeps it.",
"So it is the same as switching accounts by hand. Use only accounts that are yours: sharing one is against Anthropic's terms.",
"When the account runs low, magpie signs Claude Code in to your next account, as /login does. Sessions already open keep their account until they are restarted.",
"Requests still go from Claude Code straight to Anthropic, unchanged. Use only accounts that are yours: sharing one is against Anthropic's terms.",
],
},
zh: {
@@ -80,9 +79,8 @@ const words = {
keep: "Claude Code 始终登录",
gateway: "Claude Code 的请求经过 magpie,每个请求都发给有额度的账号;Claude Code 自己的登录保持你选的账号不变。",
tip: [
"magpie 把下一个账号的登录写到 Claude Code 自己保存登录的地方,和 /login 一样;剩余额度通过运行 Claude Code 自己的 /usage 读取。已经打开的会话继续用原来的账号,直到重新启动。",
"每个请求仍由 Claude Code 本身发出,直接发往 Anthropic,原样不改;magpie 一个都不发。设了自己代理的账号继续走它的代理。",
"所以这和你手动切换账号是一样的。请只用你自己的账号:共享账号违反 Anthropic 的条款。",
"账号额度快用完时,magpie 把 Claude Code 登录到你的下一个账号,和 /login 一样。已经打开的会话继续用原来的账号,直到重新启动。",
"请求仍由 Claude Code 直接发往 Anthropic,原样不改。请只用你自己的账号:共享账号违反 Anthropic 的条款。",
],
},
};