Files
magpie/internal
yetone 657e48abbf routing: a request whose agent left in the retry pause says it was canceled, not "tried again in 2s" (#1894, heng91)
heng91's relay was unreachable while their proxy was off; magpie answered
the relay's 503 with its short same-one retry (or a group's replan), and
they closed the Claude Code / Codex window in the pause. The gateway
already stopped there: the pause selects on the request's context, the
route ended with 499 and the upstream was asked nothing more. But the
trace never said so: the last try kept only its Again, so the Routing
page's story ended on "... it is tried again in 2.0 s" and the list said
"499 · failed", which reads as the closed session still retrying.

- gateway: the three pauses (the last one left asked again, the same
  after spentAfter, and the group's replan through pauseAlive) mark the
  try whose pause it was `Gone` when the agent leaves in it.
- Routing page: such a try says the agent canceled the request before the
  retry and nobody is asked again (en, zh, zh-TW, ja, de); the request
  list and the outcome label say canceled; the replay's dot goes home.
- docs/subsystems/gateway-routing.md says so.

Reproduced first with a fake upstream (httptest) answering 503 and one
hanging, a real gateway server and a client that disconnects: single
provider, group replan, streamed and not, hang mid-try. In every case the
route ended at once with nothing in flight and the upstream saw no
further request (the hanging one saw its request canceled); only the
trace's last line was wrong. The plugin fetch path already sends the
host an abort on cancel (host.js "abort").

Run:
- TestAgentGoneInTheRetryPause (new, -race): agent leaves in the pause,
  single and group; upstream count stays, route done 499, no try in
  flight, last try Gone. Red with the Gone marking removed (Gone false),
  and red with the pauses ignoring the context (route not done).
- routing-agent-gone.test.cjs (new): Chromium and WebKit, en/zh/ja/de,
  1100 and 420 wide, 16/16; red (0/4) with the story and label change
  reverted.
- go test -tags nogui ./internal/gateway ./internal/gui; routing-*,
  rest-try-now and ledger-retried GUI tests on both engines; gofmt -l;
  GOOS=linux and GOOS=windows go vet -tags nogui on both packages.

Not tried: the reporter's own relay and proxy, or a real Claude Code /
Codex window closed mid-pause.

The one other red in that GUI run, routing-wb-restricted at 420 in
Chromium under the full run (passes alone 3/3), is filed as #1905.
2026-10-13 11:21:28 +08:00
..
settings: keep awake can keep the display on too (#975, Hu9956: magpie's keep-awake held the system up, but the screen still went black and locked, and their agents record the screen to check their work, which a locked screen stops) — Settings › General's "Keep awake while agents work" row now has three segments, Off / On / Screen on too, saved as keepAwake and the new keepAwakeDisplay (default off, so On and every existing settings.json behave as before). awake.Keep takes a Level (Off, System, Display) in place of a bool; a level changed while held releases and takes the hold anew. On a Mac the display level runs caffeinate -i -d -w <pid> (pmset -g assertions on a caffeinate of the same flags shows PreventUserIdleDisplaySleep beside PreventUserIdleSystemSleep); on Windows SetThreadExecutionState gets ES_DISPLAY_REQUIRED too; on Linux logind's idle inhibitor (systemd-inhibit --what=idle:sleep, unchanged) is all there is, and whether the screen stays on is up to the desktop. keepAwakeDisplay is this computer's own (KeepOwn) and goes in prefsKeep, so another setting's save keeps it. The row's line says the display stays on when it's chosen; it keeps its English in data-en, so a language change re-translates it. zh/ja/de strings added. No TUI or CLI has keep-awake, so none changed. TestKeepDisplay (taken once, taken anew with the display, not again at the same level, back to System, released at Off), TestCaffeinateArgs, TestExecutionState (GOOS=windows test build) and TestKeepAwakeKeptAndOwn cover it; go test ./internal/awake ./internal/settings ./internal/gui ./internal/gateway pass, -race -count=5 on awake. keep-awake.test.cjs now runs en/zh/ja/de at 900px and 440px in Chromium and WebKit (display posts keepAwake+keepAwakeDisplay true, the line changes, another setting's save keeps it, segments fit the row, On and Off clear it, no click moves the page): 32/32 twice; gui-ja, gui-de, i18n-keys and click-scroll pass. go vet (darwin, windows, linux), darwin, linux (nogui) and windows builds pass. Not tried with an agent recording the screen; the reporter is asked to confirm.
2026-10-06 15:33:28 +08:00
…
…