routing: a skipped member's story line shows another member's logo, or none — `logoed` reads only `r.order`
TL;DR
Routing 页的 story 里,被 roomy() 跳过的成员(r.left)那一行拿不到自己的 provider 图标:logoed(s, r) 只遍历 r.order,所以「不参与…200K」这条实际是 OpenCode Zen Free 被跳过,行首却没有 Zen 图标;当时 r.order[0] 是 codearts,看起来就像 CodeArts 被跳过、200K 是 CodeArts 的窗口。修复:logoed 同时遍历 [...(r.left || []), ...r.order],并把 r.left 纳入 renderSteps 的 logos memo key;回归测试在 routing-log-icons.test.cjs。
Symptom
On the Routing page, the story line for a member the gateway skipped before trying it shows no logo of its own — and when the surrounding request's order[0] is another provider, the anonymous line reads as if it were about that provider. In my case the line
不参与:这个请求超出它 200K 的上下文窗口,发给它只会被拒绝。只有能容下的都用完额度时才会问它。
(the English wording is “{who} is left out: this request is longer than its {n} context window…”) was about opencode-zen-free/deepseek-v4.1-flash-free — the trace's r.left entry is id: opencode-zen-free, name: OpenCode Zen Free, icon: file:808e1ca7659cb52e.ico, who: API key, window: 200000 — but it led with no Zen logo, and the request's order[0] at that moment was codearts, so the 200K looked like CodeArts' window. (The 200K number itself is a separate stale-catalog problem on the Zen plugin.)
Root cause
logoed(s, r) in internal/gui/assets/plugins/routing/client.js searches only r.order:
for (const w of r.order) {
for (const n of new Set([who(w), w.name].filter(Boolean))) {
...
}
}
r.left members are deliberately absent from r.order (roomy removes them before any is tried), so a line naming a skipped member can never get that member's logo. If the line uses a name that also occurs in r.order (a key called API key, a provider name shared by several members), the first matching order member's logo wins instead — which is how a Zen line can end up with CodeArts' logo. The logos memo key also maps only r.order, so a change in r.left does not redraw the line.
Proposed fix
Search both lists, with the skipped members first so their own names win:
for (const w of [...(r.left || []), ...r.order]) {
and include r.left in the two logos memo keys in renderSteps.
I put the change plus a regression case in routing-log-icons.test.cjs on a branch: https://github.com/MYCF711/magpie/compare/main...fix/routing-left-logos (the repository's pull_request_creation_policy is collaborators_only, so I could not open it as a PR here).
Reproduced on magpie 0.1.1783; the Routing trace at 2026-10-28T06:59:24+08:00 carried exactly that left entry while order[0] was codearts.
Verified the regression case on Windows with Playwright 1.64 / Chromium: with main's client.js the new routing-log-icons case fails (aside line "API key 不参与:… 200K …" has no .rt-named logo); with the branch's client.js all 7 routing-log-icons cases pass (en, zh, zh-TW, ja, de). The branch commit is https://github.com/MYCF711/magpie/commit/003611a028736629dcc0e254846e58b4142e6d24 on top of https://github.com/MYCF711/magpie/commit/e541bf0d0ee1330c92350b3f4c1249fb6525be93.
Thanks @MYCF711 — ported in 0a7633136 (with Co-authored-by), released in v0.1.1791.
One change from the branch: list order alone can't decide between two members with the same name. Your case has the skipped Zen member as API key, and an order key can be called API key too. With left first, a failed order key's try line took Zen's logo. With order first, Zen's line took the order key's. So now each story line carries the member it is about when it has one: a skipped member's line (leftWhy) and a try's line (tried()). That member wins a tie at the same position. Otherwise order members come before skipped ones. The memo keys hold that member and every r.order + r.left logo.
routing-log-icons has your case, plus an order key also named API key that is tried and fails. Both lines must lead with their own logo. It goes red with r.order only, with left-first and with order-first.
Leaving this open until you confirm it on your Routing page.
Confirmed against 0a7633136. logoed now walks new Set([about, ...r.order, ...(r.left || [])]), and both logos memo keys carry the about member, so a skipped member's line can find its own provider.
The tie-break you added is the part I did not design and it is better than what I proposed: my patch only put r.left first, which is exactly the failure you describe — a try line on an order key also called API key would have taken Zen's logo. "The member the line is about wins, then order over skipped" covers both directions, and the three hand-broken variants in the commit message (order only / left-first / order-first) are the right red cases.
What I have not done: looked at the real Routing page on this machine. The scenario needs a request longer than a member's window with that member present in r.left; the trace still carries r.left entries, but I have not caught one and rendered it. So this is a code-and-test confirmation, not a screenshot. If that is enough for you, this can close.
关门依据:0a7633136 已在 v0.1.1791 发布,logoed 走 new Set([about, ...r.order, ...(r.left || [])]),logos memo key 带 about 成员;我核过代码与新增的三组反向用例。真机 Routing 页的长请求场景没抓到可渲染的样本,这一项按代码+测试确认,不按截图。