routing: let Free first order each band by another routing (free/smart — free seats by expiry, paid seats by renewal)
What
free (Free first) puts the seats whose model costs nothing first, and the paid ones after — but each band keeps the listed order, and every allowance signal is ignored inside a band (see routes.FreeFirst's comment: "It orders one tier only, unlike Smart … Among the paid, the listed order stands rather than Smart's renewal-weighted one").
That is fine when each band has one seat. It isn't when a band holds several accounts whose allowances renew or expire on different days.
What I'd like: Free first as the first tier, and a chosen routing (Smart, Weekly pace, Least used, In order) inside each band — free seats that expire soonest first, then paid seats that renew soonest first, instead of both bands being listed order.
Why it matters here
One group, auto/deepseek-v4.1-flash, four members: opencode-go (paid subscription) and three workbuddy* model members backed by five free accounts whose credits expire on different days (11-06, 11-14, 11-23 from the Usage page).
With free on 2026-10-23, 10:00–21:30 (2,121 requests): workbuddy-ai 77%, workbuddy 17%, opencode-go 6%. Once the free band rested (20:00 onwards) the paid seat was tried first — correct for free, but inside each band nothing ordered by expiry, so a seat with credits ending 11-14 sat behind one ending 11-23 purely because it was listed that way.
With smart instead, the whole pool orders by renewal, which spends the paid subscription first when its window renews earliest (10-26 here) while the free credits last to 11-06+ — the opposite of what free is for. The two routings each answer half the question, and there is no way to ask for both.
#3054's note suggests setting a provider's own routing "if the paid seats should be spent smartly among themselves". That works per provider, but not for a pool where the free band is several accounts of the same provider (WorkBuddy) — the provider can only have one routing, and it is already the one that splits free from paid.
Proposal
Give free an inner routing, defaulting to the current behaviour:
routes.FreeFirstsplits the seats bySeat.Free(as it does now), then asks the configured inner strategy for each band's order instead ofidentity.- Name it in the picker as e.g.
free/smart,free/pace,free/usage,free/order(or one extra field in the Routing page: "免费优先 · 档内按 ⟨smart⟩"). - Default stays
free/order, so nothing changes for existing users, and a pool with no free model still behaves asorder.
Related (both open, both block the expiry half for plugin providers)
#2265— the plugin host's window whitelist dropsrunsOutAt/runsOut, so a plugin provider's credit expiry never reaches routing; for WorkBuddy the seat has no renewal at all, so no band ordering can rank it by expiry until that lands.#3090—freesilently spends in order when no member's cost is known.
Environment
- magpie
0.1.1327(Windows, GUI), plugin@magpie-community/opencode-workbuddy-auth0.1.30 - Gateway
127.0.0.1:3425; routing seen through/v1/magpie/traceandrouting/YYYY-MM-DD.jsonl
中文摘要
现在 free(免费优先)只分两档:免费的在前、付费的在后,档内一律按列表顺序,不看到期时间。我这个号池里免费档有 5 个 WorkBuddy 账号(积分分别在 11-06 / 11-14 / 11-23 到期),付费档是 opencode-go;结果是:免费档内快到期的号并没有被优先使用,只能靠列表顺序碰运气。而换成 smart 又反过来——它按「谁先重置先用」,会把 10-26 就重置的付费订阅排到最前,免费积分反倒闲置。
两个路由各答对一半,却没有办法组合。希望能给 free 加一个「档内路由」参数:free/smart、free/pace、free/usage、free/order,默认 free/order 保持现状不变。
另外 #2265 是前置问题:插件提供的 provider(WorkBuddy 就是)上报的积分到期时间目前到不了路由,档内按到期排序要等它修好才真正生效。
临期优先吗?
A data point from the same need (opened as #3428): per-band routing alone is not enough for plans whose credits arrive in batches with different end dates.
With only Seat.Used (a share) and Seat.Soon (when), a band can be ordered by date — but not by what is wasted by waiting. On WorkBuddy: two accounts both expiring 11-14, one with 10 credits left and one with 2000. free/smart orders them identically, and free/pace does not help either — Pace weighs the window's share over hours, while the expiring batch is only part of the plan, so an account at 5% used whose 1500-point batch is untouched looks far less urgent than its batch actually is.
Ranking the expiring band needs QuotaWindow.RunsOut (how many credits are lost at RunsOutAt), which allowanceOf currently drops and Seat has no field for. With that count a band can be ordered by RunsOut / hoursUntil(Soon[0]), which is the ranking users actually want.
So #3428 is the prerequisite for the "paid band by expiry" half of this proposal; the free half works today.