Files
magpie/internal
yetone ca221e115e routing: a pick lets the stage go live when the reader is back to newer requests
未寒 on Discord (#feedback, 10-28): the Routing page's stage stayed on
a 16:36 Mozilla request to qwenwork/flash, "The agent canceled the
request", headed "16:36 的请求是怎么路由的", while the requests list
under it went on with auto/deepseek-v4-flash at 17:08 and 17:09.

Cause: that head is a pick. A click on a list row, the errors stat,
the context card, Usage's openRoute or the tray's ?req= pins the stage
to one request. #1389 lets a pin go only when the request leaves the
60 the page keeps, so at a calm pace a pick holds for hours. A reader
who left for another app or another page and came back finds the
stage on a request they no longer remember picking, and reads it as
stuck.

Fix (plugins/routing/client.js): the reader leaving while a pick holds
the stage (window blur, another page, the window hidden) marks the
newest request then. Back in sight and focused, if a request newer
than the mark has come, the pin is dropped and the stage follows live
(followListed). This is checked in start() when the poll was running,
and in the poll's catch-up pass when it had slept out of sight, so
requests read only on return count too. Back to nothing new, the pick
stays. A reader who never left keeps it as requests come, as before. A
new pick clears the mark. Day mode and a replay are left alone. The
tray panel has no pin, so there is no sibling there.

Test: internal/gui/tests/routing-pin-away.test.cjs. The canceled
request is picked from the list. It holds while requests come, and it
holds after leaving and coming back to nothing new. The reader then
leaves while 8 more come, still within the 60, and comes back: the
head is "How the last request was routed", there is no Back to live,
the first row is pressed and the stage shows the newest model. Three
ways of leaving (another app, another page, the window hidden), en at
1100 and zh at 420, in Chromium and WebKit.

Run on mote at this head (rebased on c5cdb043e; main to 5a85a9836 changed nothing under internal/gui, and the two pin files ran again there):
- routing-pin-away: red on the old code in every case (the head kept
  "How the request at … was routed…Back to live"); green after.
- All routing-*, panel-routing*, i18n-keys, gui-zh-tw, usage-ledger,
  click-scroll and dates-gui-lang GUI files in both engines (132 files):
  1755 of 1793 pass. The 38 reds are in 9 files. Run alone, they are
  red the same way on an unchanged copy of main c5cdb043e (33 there,
  36 here, at mote load 70 to 200; the counts in the rule-editor files
  vary between runs): routing-row-swap #3799, routing-steady #3412,
  routing-story-shrinks #3954, usage-ledger #4078, routing-rule-drag
  #3789, routing-rule-remove #3094/#3096, routing-rules-line #3593,
  and routing-failed-open's en live case, which had no issue and is
  filed as #4105. routing-pin-away and routing-pin-leaves are green.
- go test -tags nogui ./internal/gui/ (TestCoreScriptBudget and the
  asset tests): ok. TestLoopGuardLeavesOrdinaryRepliesAlone and
  TestAntigravityTurnedAwayHintIsTheRoutingPages (they read
  client.js): ok.
- GOOS=linux and GOOS=windows go vet -tags nogui ./internal/gui/...:
  ok. gofmt -l: clean. No budget raised.

Broken by hand:
- Dropping the poll's catch-up check: the another-page and
  window-hidden cases go red (the poll slept while away), and
  another-app stays green.
- Dropping the check in start(): the another-app cases go red in both
  engines.

Not tried: the real Wails window's blur and focus in WKWebView,
WebView2 and WebKitGTK. The test dispatches the window events and fakes
document.hidden. Not tried with the reporter's own gateway either.
2026-10-29 01:19:25 +08:00
..
…
…
…