Skip to content

Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.

routing: accounts renewing together spend first the one whose credits left lapse first (zhaocai_83020 on Discord)

yetone19dc5b9252be
diff --git a/docs/reference.md b/docs/reference.md
index 7be7f82bc..5529897ca 100644
--- a/docs/reference.md
+++ b/docs/reference.md
@@ -1628,7 +1628,11 @@ each of these groups ordered by the share used.
(WorkBuddy's packages, each ending on its own day), count as renewing
when they run out: of several WorkBuddy accounts, the one whose credits
left end first goes first. The daily Free Plan credits aren't counted,
- since they end at the same midnight on every account. A Claude account
+ since they end at the same midnight on every account. Accounts that
+ renew in the same hours (WorkBuddy's free accounts all at the month's
+ end) go by when their credits left run out after that: the one whose
+ credits are lost first goes first, and one with none that run out
+ after those whose do. A Claude account
magpie knows nothing of yet goes first once, to learn what it has left
from the answer; any other unknown account goes after those known,
and is still tried when they fail, ahead of any at 90% or more.
diff --git a/docs/subsystems/gateway-routing.md b/docs/subsystems/gateway-routing.md
index adde7c18d..5d404b453 100644
--- a/docs/subsystems/gateway-routing.md
+++ b/docs/subsystems/gateway-routing.md
@@ -185,7 +185,7 @@ recorded as a prediction failure (`noPrediction`).
- A streamed reply stuck in a loop is ended, not let run to its output limit (#1359, Moody-Sin: WorkBuddy's DeepSeek v4.1 flash reasoned round "Now." "Writing." "Go." "Let me write." "OK." until max tokens while dsh and Pi waited). `holdWriter.Write` feeds every streamed try, passed through or translated, a key's, a built-in subscription's or a plugin's (a moved WorkBuddy's fetch in the plugin host, `TestLoopEndsWorkBuddysReply`), in each of the agent's protocols, to a `loopGuard` ([`loop_guard.go`](../../internal/gateway/loop_guard.go)). It cuts the reasoning and the text, each apart, into units, its lines and sentences (a list's `1.` or a decimal is no sentence's end), compared without case or a closing stop. A unit with no word in it (a letter run with no digit: not a brace, a rule, `0x00`, a hash or a row of numbers) isn't counted. When the last `loopWindow` (256) counted units of either are among no more than `loopDistinct` (24) different ones, the try is cut (`cutLoop`): what came with that write goes out, then, after a blank line (two newlines when that write stopped inside a line, `holdWriter.atLine`, #2446), the protocol's stream error (`streamError`, 502) naming the loop and quoting its units, and the vendor's request is cancelled. It falls back to nobody and rests nobody (`failLoop`); its usage record's error type is `reply_loop` (`usage.LoopErrType`), and Usage counts them per model (`Totals.Loops`), as "{n} looped" beside the model's failures in the Overview's rows and the Requests ranking (#1858, `TestLoopsCountedPerModel`, `usage-loops.test.cjs`). A reply magpie translates into the agent's protocol (`streamTranslated`) whose *reasoning* loops before it has said a text or a call, and isn't a continuation, is asked again once in place instead (`loopReasks`, through `holdWriter.onLoop`; cdredfox on X, WorkBuddy AI's DeepSeek v4 flash): the agent keeps the reasoning it has, the next try's follows it in the same stream, as an empty reply's re-ask does (#667), and only a loop on that try ends the reply with the error (`TestReasoningLoopIsAskedAgain`). A reply passed through in the agent's own protocol is asked again once too, at the fallback loop (`holdWriter.mayReloop`, `letGoLoop`; #2436, lqisgod: pi's Chat stream to WorkBuddy was cut at once): when nothing of the try has reached the agent yet, in any protocol, its held bytes are dropped; when its reasoning is already passing, only a Chat stream goes on, written up to the end of the tripping event, with the next try's chunks after it. An Anthropic or Responses stream already passing still ends with the error, since a second `message_start` or `response.created` can't follow. Each re-ask, in place or at the fallback loop, counts in the usage record's tries. A loop in the text, or after a text or call, is ended at once (`TestLoopAfterTextIsNotAskedAgain`). A cycle need not be exact. Code, tables, lists, logs, CSV and base64 differ line to line or have no words, and don't trip it (`TestLoopGuardLeavesOrdinaryRepliesAlone` feeds magpie's own sources and docs through it). A reply sent whole (no stream, or Gemini without `alt=sse`) isn't read. Settings › Models › Replies › *Stop looping replies* (`noLoopGuard`) turns it off.
- A conversation going round one tool call is answered by magpie and sent nowhere (audie on Discord: Codex Desktop on WorkBuddy's deepseek-v4-pro read the same file 308 times in half an hour, and 340 times that evening, 537 credits). `stoppedToolLoop` ([`tool_loop.go`](../../internal/gateway/tool_loop.go)) runs in `serveAgent` before hooks, middleware and routing, and in the Codex backend's passthrough on Codex's own sign-in. It reads the request's own history, so it is per conversation and keeps no state: when the last `toolLoopRepeats` (8) turns are each the same calls (name and arguments, keys in any order, call ids ignored) answered with the same results (with Codex's `Wall time`, `Chunk ID` and `duration_seconds` taken out, `runNoise`) and nothing else from the user, the turn is answered in the agent's own protocol, streamed or whole (`writeLocalText` through `relayStatus`), with a notice naming the call. Any different result, or a word of the user's, starts the count again; the notice is a turn without calls, so the user's next word goes on. A body with fewer than 8 tool results isn't parsed (`mayLoop`), and only the newest 64 items of a long one are (`tailOf`, gjson), ~1ms for a 1.5MB turn (`BenchmarkToolLoopCheck`). The turn is recorded as Codex's title turns are (`answeredHere`): the Routing trace as "Tool loop stopped", and a usage row with provider `magpie`, rejected, its session and an error starting `tool loop:`. A poll that gets the same answer 8 times in a row is stopped too. Settings › Models › Replies › *Stop looping replies* (`noLoopGuard`) turns it off with the reply guard. Verification: `go test -tags nogui ./internal/gateway -run 'TestToolLoop'`.
- A Chat request's earlier turns carry the assistant's thinking back in the spelling its own client used: `reasoning_content` (DeepSeek's, which OpenCode and most clients send), `reasoning` (OpenRouter's) or `reasoning_details` (OpenRouter's structured one). A request translated to a non-Chat upstream reads whichever of the three the turn has, in that order, as the turn's thinking (`messageReasoning`, `reasoningText`, read by `parseChat` in [chat.go](../../internal/gateway/chat.go)); the passthrough has read all three since `mistralThinking` (#494), which was the one place that did. Before that the parse layer read `reasoning_content` alone, so a tool-calling session whose client spelled it another way went on from its second turn without the model's own reasoning.
-- The order of the steps a request's accounts go through, how much the accounts' own order (*Make first*) counts under each routing, and how often an allowance is read are described for users in [How magpie picks an account](../reference.md#how-magpie-picks-an-account). Smart compares renewals window by window, biggest first, each truncated to the hour (`weighRouted`), so the order decides only when every window falls in the same hour. A window's renewal is its reset, or, when what it has left runs out sooner or it has no reset, that moment (`Limit.RunsOut`, from `QuotaWindow.RunsOutAt`; `Allowance.Renewal`): the WorkBuddy plugin (0.1.14) sends it on its Credits window as the soonest end of a package with credits left (cdredfox on X). Only Smart reads it; Weekly pace, the 90%/98% tiers and rests go by the window's share and reset as before. A row on the Routing page says the share used (the fullest window's, `Allowance.For`) with when that same window renews (`Allowance.Fullest`, the trace's `usedRenews`), not the biggest window's: a Factory account 32% into its week and 16% into its month reads "32% used · renews in 3 days" while Smart still ranks it by its month (#1778). A route from before `usedRenews` says when only for an account of one window. Affinity keeps a conversation on an account at 90–97%: only `SpentShareOf` (98%, 100% In order) stops it (`affine`), while the 90% tier (`lowShare`) orders only conversations nobody has answered.
+- The order of the steps a request's accounts go through, how much the accounts' own order (*Make first*) counts under each routing, and how often an allowance is read are described for users in [How magpie picks an account](../reference.md#how-magpie-picks-an-account). Smart compares renewals window by window, biggest first, each truncated to the hour (`weighRouted`), so the order decides only when every window falls in the same hour. A window's renewal is its reset, or, when what it has left runs out sooner or it has no reset, that moment (`Limit.RunsOut`, from `QuotaWindow.RunsOutAt`; `Allowance.Renewal`): the WorkBuddy plugin (0.1.14) sends it on its Credits window as the soonest end of a package with credits left (cdredfox on X). When the renewals tie to the hour, Smart goes by that moment once more (`Allowance.Lapse`, `Seat.Lapse`), so of accounts renewing together (WorkBuddy's free accounts all reset at the month's end, plugin 0.1.35) the one whose credits left lapse first, after that end, goes first, and one telling none goes after (zhaocai_83020 on Discord). Only Smart reads it; Weekly pace, the 90%/98% tiers and rests go by the window's share and reset as before. A row on the Routing page says the share used (the fullest window's, `Allowance.For`) with when that same window renews (`Allowance.Fullest`, the trace's `usedRenews`), not the biggest window's: a Factory account 32% into its week and 16% into its month reads "32% used · renews in 3 days" while Smart still ranks it by its month (#1778). A route from before `usedRenews` says when only for an account of one window. Affinity keeps a conversation on an account at 90–97%: only `SpentShareOf` (98%, 100% In order) stops it (`affine`), while the 90% tier (`lowShare`) orders only conversations nobody has answered.
- A turn's end is told to the app for the "Task done alert" notification (itieniu on X, `turndone.go`). The trace follows each agent session's turn (`turns`, keyed by agent and session): a request is of the turn unless it has a `Kind` or is a Claude Code subagent's (`agentTurnOf`), and its reply is scanned on the way to the agent for a tool call in any wire format (`toolScan`, a JSON value such as `"type":"tool_use"` or `"finish_reason":"tool_calls"`, never a key or text). The turn is done when no request of it is going, the last reply was whole, under 400 and called no tool, and nothing more came for `turnQuiet` (4s); a session idle past `turnStale` (30m) starts over. Only a turn that ran at least `settings.TurnDoneAlert` seconds is told (`TurnDone`, set by the GUI; nil under `magpie serve`, so nothing is followed). The ChatGPT backend path (`codexBackend`) is followed the same way. `TestTurnDoneSaidAtTheTurnsEnd`, `TestTurnDoneCodexBackend`, `TestToolScan`, `turn-done.test.cjs`.
- A resting candidate is tried last (`restLast`). Of the resting candidates, a request asks only the one whose rest ends soonest, the first in order on a tie (`probeOne`, #1799). The others aren't asked by that request, so a member that is down isn't asked by every request its rest was meant to spare it from, and a group that is down whole takes one upstream request per request, not one per member. Every ready candidate is still asked in its order. A lone candidate is tried even while it rests, because there is no other. The trace still lists every member, the resting ones with their rest. Only rests are read, and a failure about the request's content or its model rests no member (a model refusal rests only `restID`), so neither leaves a member out. The same applies in `count_tokens`, embeddings and rerank, image accounts and a group's System One decision models. A Codex reset (`autoReset`) still looks over every candidate. This is like AxonHub's error-aware load balancing: the rest and its backoff are the penalty that decays, and the member back soonest is the one asked to show it is back. Keys out of their allowance aren't asked even so, not even the one back soonest or a lone one (#1772: four Ollama Cloud keys out for the week, each asked again and refused on every request). The refusal given again says when they are asked again on this magpie's clock with its offset (`heldClock`: "20:12 UTC+8", "Oct 16 09:00 UTC+8"), as do the gateway's other held errors (a capped window, a spent searcher or describer): its reader may be a Remote magpie's user on another clock. When every candidate left is a key (not a subscription account, whose resets `autoReset` may spend) resting out of quota or credit after a 429 or 402, none is asked. The first one's refusal is given again (`quotaHeld`, its words kept in the rest's `said`), saying when it is asked again. A key whose rest magpie guessed the length of, the vendor and the user naming no time (`creditRest`, or `quotaRest` with no `Provider.OwnQuotaRest`), is held so only once it was refused so twice in a row (`Rest.first`): a single refusal may be a moment's, and the next request, the agent's retry first, asks it again (zoecats on Discord: a local aggregator said 429 `insufficient_quota` "quota exhausted" for the moment it switched upstreams, and every request was answered from its rest of 15 or 30 minutes, which only the provider's "Rests" switch, `LimitRestOff`, let through before). Held, it is asked again a minute on (`Rest.askAt`, `fallbackCooldown`), once, and held again if refused (`Rest.asksAt`); a time the vendor named, or the user set, holds it from the first refusal to then. The rest itself stays as long as before, so the order still passes it over for a candidate that is ready. The last key left rests too when it is refused so, as the keys before it do. Any 429 that reaches the agent without a vendor `Retry-After`, while every candidate tried is resting, carries one: the seconds until the first of them is asked again (`soonestBack`, by `asksAt`), none after a key's first refusal. `TestRetryAfterALimitIsAsked`, `TestHeldLimitAskedAgainInAMinute`. A quota refusal with no word of when it is back rests `quotaRest` (15 minutes), or the provider's own `quotaRest` in minutes (`Provider.QuotaRestFor`, at most `MaxQuotaRest`, 8 days; `magpie provider quota-rest <id> 7d`), or until the time of day the user said its allowance comes back (`QuotaResetAt`, `Provider.OwnQuotaRest`; `magpie provider quota-rest <id> until 08:00`, or `until 00:00+08:00` on the vendor's clock; #2008, a free tier's "today's free-model token quota"). Whichever of the two was set last counts. A time the vendor names stands over it, and so does its `Retry-After`, unless that was more than `longestWait` (an hour) and so cut to it while the user's own rest is longer: then the user's stands (`TestQuotaRestsUntilTheTimeOfDaySet`). A key listed in `keys` as well as in `key` is one candidate (`KeysOn`), not asked twice. `TestAllRestingAnswersFromRest`, `TestOwnQuotaRest`, `TestQuotaHeldOnlyForKeysOutOfAllowance`, `TestFirstKeyListedTwiceAskedOnce`.
- A provider whose keys are on different plans (`KeyAccount.Plan`, `PlansMixed`; yckonnnn on X) sends each key to its plan's endpoints: every key path takes its copy through `WithKey`, which moves it there (`atKeyPlan`), on the first try and on a failover alike. `perKeyBarred` leaves out a key whose plan's list lacks the model (`PlanServing`: a pay-as-you-go model id at the Agent Plan's endpoint only answers 404), not shown in the trace; only when no key's plan has it are those keys asked. Embeddings and drawing go through the same `perKeyBarred` and `WithKey`; a video started on a mixed provider names its key in the task id (`videoStart.onKey`, `keyMark`) so its poll goes to that key's plan. `TestKeyPlansEachToItsOwnEndpoint`.
diff --git a/internal/gateway/routing.go b/internal/gateway/routing.go
index 44ca2bb3e..94d4acc8e 100644
--- a/internal/gateway/routing.go
+++ b/internal/gateway/routing.go
@@ -1488,6 +1488,7 @@ type left struct {
// (Allowance.Fullest), zero when not known
fullest time.Time
soon []time.Time // renews as Smart ranks them (Allowance.Renewal)
+ lapse time.Time // when the soonest of what is left is lost (Allowance.Lapse)
pace float64 // weekly pace: share of its week left per hour until it renews
due time.Time // when the window that pace went by renews; zero when not known
// restarts: when an auto-used reset starts its windows again
@@ -1573,7 +1574,7 @@ func weighRouted(p provider.Provider, cs []candidate, model string, from provide
pc, due := a.Pace(c.model, now)
amt, of, unit := a.Count(c.model, now)
rs := a.Restarts(now)
- wg.lefts[c.allowanceKey()] = left{used: u, renews: r, fullest: a.Fullest(c.model, now), soon: a.Renewal(c.model, now), pace: pc, due: due, amount: amt, of: of, unit: unit,
+ wg.lefts[c.allowanceKey()] = left{used: u, renews: r, fullest: a.Fullest(c.model, now), soon: a.Renewal(c.model, now), lapse: a.Lapse(c.model, now), pace: pc, due: due, amount: amt, of: of, unit: unit,
restarts: rs, dueRestart: !rs.IsZero() && due.Equal(rs), credits: spendsCredits(c.p, a)} // one not known counts as unused
}
}
@@ -1595,7 +1596,7 @@ func weighRouted(p provider.Provider, cs []candidate, model string, from provide
pace = provider.FreshPace
}
seats[i] = routes.Seat{Key: c.rest, Account: c.p.Account != nil, Known: known, Learns: learns(c, wg.lefts),
- Used: l.used, Soon: l.soon, Pace: pace, Weight: keyWeight(c), Resting: resting(c), Tokens: routed.used[c.restKey()].now(now), Credits: l.credits}
+ Used: l.used, Soon: l.soon, Lapse: l.lapse, Pace: pace, Weight: keyWeight(c), Resting: resting(c), Tokens: routed.used[c.restKey()].now(now), Credits: l.credits}
}
routed.Unlock()
if st.ByUse {
diff --git a/internal/gateway/workbuddy_runs_out_test.go b/internal/gateway/workbuddy_runs_out_test.go
index 90c294a05..ce81dacde 100644
--- a/internal/gateway/workbuddy_runs_out_test.go
+++ b/internal/gateway/workbuddy_runs_out_test.go
@@ -63,3 +63,73 @@ func TestSmartSpendsWorkBuddyCreditsRunningOutFirst(t *testing.T) {
t.Fatalf("spent last: %s", got)
}
}
+
+// zhaocai_83020 on Discord: several WorkBuddy accounts, and the credits
+// that expire soonest are to be spent first. A free account's Credits
+// window resets at the month's end, the same moment on every account
+// (plugin 0.1.35's cycleOf), and the credits it was given lapse on their
+// own days (runsOutAt). Those lapsing after the month's end ranked alike
+// and kept their order, so the account whose credits were lost first was
+// not spent first. Renewing together, the one lapsing first goes first.
+// The windows are the plugin's for a real China-site free account
+// (packages/workbuddy usage.test.mjs, CN_FREE): reset 10-31 23:59:59 +08
+// over 31 days, given credits lapsing on their own day.
+func TestSmartSpendsCreditsLapsingFirstWhenRenewingTogether(t *testing.T) {
+ old := allowances
+ defer func() { allowances = old }()
+ now := time.Now()
+ share := map[string]provider.Allowance{}
+ allowances = func(string) map[string]provider.Allowance { return share }
+ p := provider.Provider{ID: "workbuddy", Account: &provider.Account{Agent: "workbuddy", User: "a"}}
+ acct := func(user string) candidate {
+ return candidate{p: provider.Provider{ID: "workbuddy", Account: &provider.Account{Agent: "workbuddy", User: user}}, model: "hy3", rest: "workbuddy#" + user}
+ }
+ month := now.Truncate(time.Hour).Add(4*24*time.Hour + 59*time.Minute)
+ credits := func(used float64, lapses time.Duration) provider.Allowance {
+ l := provider.Limit{Used: used, Amount: used * 34, Of: 3400, Unit: "credits", Resets: month, Span: 31*24*time.Hour - time.Second}
+ if lapses > 0 {
+ l.RunsOut = month.Add(lapses)
+ }
+ return provider.Allowance{l}
+ }
+ order := func(cs ...candidate) string {
+ got, _ := weigh(p, cs, "hy3", provider.Chat)
+ var s []string
+ for _, c := range got {
+ s = append(s, c.p.Account.User)
+ }
+ return strings.Join(s, "")
+ }
+
+ // both renew at the month's end; b's given credits lapse 5 days
+ // after it, a's 50: b first, though listed second and more used
+ share["a"] = credits(10, 50*24*time.Hour)
+ share["b"] = credits(30, 5*24*time.Hour)
+ if got := order(acct("a"), acct("b")); got != "ba" {
+ t.Fatalf("lapsing first goes first: %s", got)
+ }
+ // one whose credits never lapse (none given, or an older plugin)
+ // keeps them: after one whose do
+ share["a"] = credits(10, 0)
+ if got := order(acct("a"), acct("b")); got != "ba" {
+ t.Fatalf("not lapsing last: %s", got)
+ }
+ // lapsing within the same hour: their order, for the cache
+ share["a"] = credits(10, 5*24*time.Hour)
+ if got := order(acct("a"), acct("b")); got != "ab" {
+ t.Fatalf("same hour keeps order: %s", got)
+ }
+ // the renewal still decides first: one renewing sooner goes ahead of
+ // one lapsing sooner
+ share["a"] = credits(10, 50*24*time.Hour)
+ share["a"][0].Resets = month.Add(-48 * time.Hour)
+ if got := order(acct("b"), acct("a")); got != "ab" {
+ t.Fatalf("renewal first: %s", got)
+ }
+ // and the share used before both: all but spent waits behind
+ share["a"] = credits(99, 5*24*time.Hour)
+ share["b"] = credits(10, 50*24*time.Hour)
+ if got := order(acct("a"), acct("b")); got != "ba" {
+ t.Fatalf("spent last: %s", got)
+ }
+}
diff --git a/internal/provider/routing.go b/internal/provider/routing.go
index ef3fc0fcd..54d38fc1a 100644
--- a/internal/provider/routing.go
+++ b/internal/provider/routing.go
@@ -366,6 +366,24 @@ func (a Allowance) Renewal(model string, now time.Time) []time.Time {
return out
}
+// Lapse is the soonest moment credits left in a window that counts model
+// are lost (Limit.RunsOut), zero when none is told or all have passed.
+// Smart goes by it when the renewals tie: two WorkBuddy free accounts
+// renew together, at the end of the month every one shares, but the
+// credits one was given lapse before the other's, and spent first they
+// aren't lost (zhaocai_83020 on Discord). Renewal already takes it when it
+// comes before the window renews; this tells apart those that come after.
+func (a Allowance) Lapse(model string, now time.Time) time.Time {
+ model = strings.ToLower(model)
+ var t time.Time
+ for _, l := range a {
+ if l.applies(model) && l.RunsOut.After(now) && (t.IsZero() || l.RunsOut.Before(t)) {
+ t = l.RunsOut
+ }
+ }
+ return t
+}
+
// Full is when an account used up for model can take it again: the last
// reset of its windows that are full, zero when none is or it isn't known.
func (a Allowance) Full(model string, share float64, now time.Time) time.Time {
diff --git a/internal/routes/routes.go b/internal/routes/routes.go
index f3d9fae00..738057b42 100644
--- a/internal/routes/routes.go
+++ b/internal/routes/routes.go
@@ -33,6 +33,10 @@ type Seat struct {
Used float64
// Soon is when its windows renew, the biggest first (Allowance.Renewal)
Soon []time.Time
+ // Lapse is when the soonest of what it has left is lost, apart from
+ // its windows' renewals (Allowance.Lapse): zero when not told. Smart
+ // goes by it when Soon ties.
+ Lapse time.Time
// Pace is its week left per hour until that renews; an account not
// known has a whole week (provider.FreshPace), a key none
Pace float64
diff --git a/internal/routes/strategies.go b/internal/routes/strategies.go
index 121be9d63..2940037a4 100644
--- a/internal/routes/strategies.go
+++ b/internal/routes/strategies.go
@@ -45,7 +45,10 @@ func identity(n int) []int {
// spends a reset about to run out by itself (auto-use on, its windows used)
// renews when that is spent, if sooner: what it has left is lost there just
// the same (#718). Only holding one, or one that runs out after the week
-// renews, changes nothing. Those alike stay in their order, keeping the
+// renews, changes nothing. Renewing in the same hours, the one whose
+// credits left lapse first (Seat.Lapse) goes first: WorkBuddy's free
+// accounts all renew at the month's end, but the credits each was given
+// end on their own days (zhaocai_83020 on Discord). Those alike stay in their order, keeping the
// vendor's prompt cache warm. Past that, whichever has the most left, and
// one all but used up only when nothing else can take it, one that goes
// on on its credits first of those (spentBefore). Only the windows
@@ -89,7 +92,16 @@ var Smart = Strategy{Order: func(_ string, seats []Seat) []int {
}
return x.Before(y)
}
- return false
+ // renewing in the same hours: the one whose credits left lapse
+ // first, to the hour; one that tells none after those that do
+ x, y := a.Lapse.Truncate(time.Hour), b.Lapse.Truncate(time.Hour)
+ if x.Equal(y) {
+ return false
+ }
+ if x.IsZero() || y.IsZero() {
+ return y.IsZero()
+ }
+ return x.Before(y)
})
sort.SliceStable(low, func(i, j int) bool { return seats[low[i]].Used < seats[low[j]].Used })
sort.SliceStable(spent, func(i, j int) bool { return spentBefore(seats[spent[i]], seats[spent[j]]) })
diff --git a/site/public/docs/ja/start.html b/site/public/docs/ja/start.html
index a11509d3b..1271a78a1 100644
--- a/site/public/docs/ja/start.html
+++ b/site/public/docs/ja/start.html
@@ -172,7 +172,7 @@
<div class="callout"><b>何もしなくてもできるグループ。</b> すでに持っているモデルを提供する 2 つ目のプロバイダを追加すると(Claude サブスクリプションと Copilot の Claude Opus、DeepSeek 自身の API と OpenRouter の DeepSeek など)、magpie はそれを提供するすべてのプロバイダにまたがるグループ <code>auto/&lt;model&gt;</code>(モデル自身の ID。例: <code>auto/claude-opus-4.6</code>。以前の <code>group/auto-…</code> も引き続き使えます)を自動で作ります。名前はベンダーごとの表記の違い(<code>deepseek/deepseek-chat</code>、<code>deepseek-chat</code>)を吸収して照合されます。エージェントにこれを選ぶとリクエストがすべてに分散されます。不要なものは <code>magpie group rm</code> で非表示にできます。</div>
<div class="table-wrap"><table>
<tr><th>ルーティング</th><th>先に使われるもの</th></tr>
- <tr><td>スマート <code>smart</code></td><td>デフォルトです。メンバーのアカウントとキーをまとめて扱い(グループ内のグループは 1 つとして扱います。下記参照)、クォータに余裕のあるサブスクリプションのうち、利用枠が最も早く更新されるもの。基準は週の枠です。週の枠がなく 5 時間枠だけのアカウント(Claude Enterprise)は 5 時間枠で判断されるため、それより後に週の枠が更新されるものすべてより先になります。リセットのないクレジット(WorkBuddy のパッケージはそれぞれの日に失効します)は、残りのうち最も早く失効する時点で判断されるため、クレジットが最も早く失効する WorkBuddy アカウントが先になります。失敗後に休止中のものは最後に回ります。</td></tr>
+ <tr><td>スマート <code>smart</code></td><td>デフォルトです。メンバーのアカウントとキーをまとめて扱い(グループ内のグループは 1 つとして扱います。下記参照)、クォータに余裕のあるサブスクリプションのうち、利用枠が最も早く更新されるもの。基準は週の枠です。週の枠がなく 5 時間枠だけのアカウント(Claude Enterprise)は 5 時間枠で判断されるため、それより後に週の枠が更新されるものすべてより先になります。リセットのないクレジット(WorkBuddy のパッケージはそれぞれの日に失効します)は、残りのうち最も早く失効する時点で判断されるため、クレジットが最も早く失効する WorkBuddy アカウントが先になります。同時に更新されるアカウント(無料アカウントはすべて月末)は、その後に残りのクレジットが先に失効するものが先になります。失敗後に休止中のものは最後に回ります。</td></tr>
<tr><td>順番どおり <code>order</code></td><td>最初のモデルが応答できなくなるまでそれを使い、次へ進みます。</td></tr>
<tr><td>持ち回り <code>rotate</code></td><td>各会話の次のターンを、次のメンバーのアカウントやキーに送り、負荷を分散します。</td></tr>
<tr><td>使用量の少ない順 <code>usage</code></td><td>利用枠の残りが最も多いアカウントやキー。</td></tr>
diff --git a/site/public/docs/start.html b/site/public/docs/start.html
index de4f821fe..54df31e28 100644
--- a/site/public/docs/start.html
+++ b/site/public/docs/start.html
@@ -172,7 +172,7 @@
<div class="callout"><b>Groups you get without doing anything.</b> Add a second provider that serves a model you already have — Claude Opus from your Claude subscription and from Copilot, DeepSeek from its own API and from OpenRouter — and magpie makes it a group by itself, <code>auto/&lt;model&gt;</code> (the model's own id, as in <code>auto/claude-opus-4.6</code>; the older <code>group/auto-…</code> id still works), over every provider that serves it. The name is matched however each vendor spells it (<code>deepseek/deepseek-chat</code>, <code>deepseek-chat</code>). Pick it for an agent to spread its requests over all of them; <code>magpie group rm</code> hides one you don’t want.</div>
<div class="table-wrap"><table>
<tr><th>Routing</th><th>What goes first</th></tr>
- <tr><td>Smart <code>smart</code></td><td>The default. Over the members’ accounts and keys together (a group in the group as one, see below): of the subscriptions with quota to spare, the one whose allowance renews soonest. The week decides; an account with five hours and no week (Claude Enterprise) goes by its five hours, so ahead of every week renewing later. Credits with no reset (WorkBuddy’s packages, each ending on its own day) count as renewing when the soonest of those left run out, so the WorkBuddy account whose credits end first goes first. One resting after a failure goes last.</td></tr>
+ <tr><td>Smart <code>smart</code></td><td>The default. Over the members’ accounts and keys together (a group in the group as one, see below): of the subscriptions with quota to spare, the one whose allowance renews soonest. The week decides; an account with five hours and no week (Claude Enterprise) goes by its five hours, so ahead of every week renewing later. Credits with no reset (WorkBuddy’s packages, each ending on its own day) count as renewing when the soonest of those left run out, so the WorkBuddy account whose credits end first goes first; accounts renewing together (free ones at the month’s end) go by whose credits left end first after that. One resting after a failure goes last.</td></tr>
<tr><td>In order <code>order</code></td><td>The first model until it can’t answer, then the next.</td></tr>
<tr><td>In turn <code>rotate</code></td><td>Each conversation’s next turn goes to the next member’s account or key, spreading the load.</td></tr>
<tr><td>Least used <code>usage</code></td><td>The account or key with the most of its allowance left.</td></tr>
diff --git a/site/public/docs/zh/start.html b/site/public/docs/zh/start.html
index f73bb4224..748b40100 100644
--- a/site/public/docs/zh/start.html
+++ b/site/public/docs/zh/start.html
@@ -172,7 +172,7 @@
<div class="callout"><b>不用手动建的组。</b>再加一个供应商,只要它提供的模型和已有的同名(比如 Claude 订阅和 Copilot 都有 Claude Opus,DeepSeek 官方 API 和 OpenRouter 都有 DeepSeek),magpie 就会自动把它们组成一个路由组:<code>auto/&lt;模型&gt;</code>(模型自己的 id,比如 <code>auto/claude-opus-4.6</code>;以前的 <code>group/auto-…</code> 也照样能用),包含所有提供这个模型的供应商。名字按各家不同的写法匹配(<code>deepseek/deepseek-chat</code> 和 <code>deepseek-chat</code> 算同一个)。给 Agent 选这个组,请求就会分摊到这些供应商上;不想要的可以用 <code>magpie group rm</code> 隐藏。</div>
<div class="table-wrap"><table>
<tr><th>路由</th><th>谁排在前面</th></tr>
- <tr><td>智能 <code>smart</code></td><td>默认。把成员的账号和 Key 放在一起排(组里的路由组算一个,见下文):还有余量的订阅里,额度最先重置的排第一。看周额度的重置时间;只有 5 小时额度、没有周额度的账号(如 Claude Enterprise)看它的 5 小时重置,所以排在所有更晚重置的周额度前面。没有重置时间的积分(WorkBuddy 的积分包,各自到期)按剩余积分最早过期的时间算,所以积分最先过期的 WorkBuddy 账号排第一。失败后在休息的排最后。</td></tr>
+ <tr><td>智能 <code>smart</code></td><td>默认。把成员的账号和 Key 放在一起排(组里的路由组算一个,见下文):还有余量的订阅里,额度最先重置的排第一。看周额度的重置时间;只有 5 小时额度、没有周额度的账号(如 Claude Enterprise)看它的 5 小时重置,所以排在所有更晚重置的周额度前面。没有重置时间的积分(WorkBuddy 的积分包,各自到期)按剩余积分最早过期的时间算,所以积分最先过期的 WorkBuddy 账号排第一;同时重置的账号(免费账号都在月底)再看剩余积分哪个先过期。失败后在休息的排最后。</td></tr>
<tr><td>按顺序 <code>order</code></td><td>先用第一个模型,它答不了再换下一个。</td></tr>
<tr><td>轮流 <code>rotate</code></td><td>会话的每一轮交给下一个成员的账号或 Key,均摊负载。</td></tr>
<tr><td>最少使用 <code>usage</code></td><td>剩余额度最多的账号或 Key 排第一。</td></tr>