cmux NEXT agent pane: a crashed page retries on its own; Chromium chats ignore their hidden WebKit view's end

TE
5d ago
+344-29

Leo, 2026-11-01, with a screenshot of "The agent pane crashed. [Reload]" over his chats: "how come it says this??? why doens't it just retry on its own", and after it: "i had to close and reopen".

What happened on his Mac (NIGHTLY, 2026-10-31 23:15 local)

  • WebKit's own GPU process was SIGKILLed three times in 20 s (launchd: signal service: caller = cmux[31679], value = 0x9 at 23:14:54, 23:15:01, 23:15:14.353). The caller is the WebKit UI side inside cmux; no cmux code kills a GPU process. Memory pressure was warning (the WebKit browser tab's line in the same burst).
  • 4 ms after the third kill WebKit ended every web content process (GPUProcessCrashedTooManyTimes). Other app pages (cmux.icon-picker, cmux.apps, cmux.markdown, cmux.changelog) reloaded by themselves. All 19 agent pages (18 chats + New Tab) logged reason=unknown pid=0 engine=cef ... no automatic reload and showed the notice.
  • The 19 chats showed in Chromium. What ended was the hidden WebKit view under each one, not the Chromium renderer. PageWebView.contentProcessTerminated still reset the page's router (the bridge of a live Chromium document) and the pane showed the notice over a chat whose renderer was still running.

Change

  1. A page that shows in Chromium ignores the end of its hidden WebKit view's process (PageWebView.webContentEnded). It logs one line and does not reset the router or notify the host. On Leo's Mac this alone would have left all 19 chats untouched.
  2. A real end retries on its own (AgentPageCrashRetry, AgentPageCrashBudget, wired in AgentPaneView+CrashNotice.swift). A pane on screen loads again once its backoff has passed (0 s, then 1 s, then 4 s). A pane nobody sees waits until it is next shown, so 19 background chats don't start 19 processes at once. No notice shows while it recovers. The fourth end within 60 s shows the notice with Reload, and Reload starts a fresh budget. Closing the chat, or the page loading again by itself, cancels an owed retry. The per-page log lines and the crash marker stay; the per-page line now says loads again by itself or kept ending: the crash notice offers Reload.
  3. The retry and Reload start a new process. On WebKit they load the document instead of calling reload(), which does nothing for a view whose process ended before its first commit (it has no URL). On Chromium they reload the tab, which starts a new renderer.

Why Reload didn't bring the chats back for Leo is not proven from the logs. Only one of the 19 logged loaded again (23:15:22) after a Reload. The likely part is (1): a Reload of a chat whose live bridge had been reset. With (1), those chats are never torn down in the first place.

Tests

  • AgentPageCrashRetryTests: the budget (3 retries with backoff, then the notice, sliding window, Reload resets); a chat on screen loads again with no notice and starts a WebKit load; a background chat waits until shown; a crash loop shows the notice; a chat that came back by itself or closed is not retried.
  • PageWebViewCrashReloadTests.aHiddenWebKitEndUnderAChromiumPageEndsNothing: the exact case from Leo's Mac. A Chromium page gets WebKit's termination callbacks, the host hears nothing, the page keeps Chromium, nothing reloads; its Chromium renderer crashing still reports. The .ended test now also checks that Reload starts a WebKit load.
  • AgentPageTerminationsTests: those chats now start with their retries spent, so they keep testing the notice and group Reload.

The failing tests are committed first (faff9c3158d), then the fix.

Observed / Not run

  • Ran: scripts/cmux-next/prepush-gate.py (no new violations). Swift suites run on the fleet: see the comment below.
  • Not run: a live reproduction on a build (a GPU process kill under memory pressure).

Changelog

  • Fixed: An agent chat whose page process ended now loads again on its own instead of showing "The agent pane crashed."; the notice shows only if it keeps crashing.

risk: normal (agent pane crash path; no data or persistence).

šŸ¤– Generated with Claude Code

Agent session: agent session


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes the agent pane crash notice showing over chats that still worked, and makes a genuinely crashed page retry on its own.

  • A page that shows in Chromium ignores the end of its hidden WebKit view's process, so a WebKit-side crash no longer resets a live Chromium page's bridge or shows the notice.
  • A page whose process actually ends retries on its own with backoff (0, 1, 4 s); the crash notice shows only after 3 retries within 60 s, and Reload starts a fresh budget.
  • Background chats wait until next shown before retrying, so many ending at once don't all start processes.
  • Retry and Reload start a new process: WebKit loads the document, Chromium reloads the tab.