Agent pane: a chat's last frame stays until its live page is ready, instead of going dark

Merged
TE
10d ago
+123-9

Leo, 2026-10-27: “There's still that black screen and what not in the agent chat area. Plus we have this flicker render when it starts trying to render a bunch of stuff again.”

The saved transcript frame was removed after three seconds even when the live chat page had not painted, so the pane briefly replaced a visible chat with its empty loading state.

Keep that frame until its page is revealed. A cover over a page that has already painted still expires at the normal deadline. Delayed reveals carry their frame's identity, so an old tab cannot clear the next tab's cover; closing, moving or parking a page clears its held frame and predicate. The native Loading readiness budget is a separate fix (#24384 successor), and this patch does not claim to close that later reveal gap by itself.

Timer stop and cleanup: the launch-image deadline is one-shot, cancelled by clearLaunchImage. The saved frame ends on live-page reveal or content detach/tab change. clearLaunchImage also drops the predicate and callback and ends LaunchImageHold; deferred launch work retains its independent four-second backstop.

Reproduce and repair

Focused command for both legs:

cmux-ci run --class light --script scripts/ci/package-test-lane.sh \
  --arg suite --arg Packages/macOS/CmuxNext --arg LaunchFirstFrameRevealTests \
  --ref <exact-sha> --key <receipt-key> --timeout 2400
  • Deadline mutation: 322c1f5c715dc58917cf67102845434bf8515dea removes only the deadline guard from the retained #24262 head. Fleet step cd3f9a67d414ef7619ff0d3e failed on aws-m4pro-2 with exactly the expected launchImageView == nil failure in theLastFrameWaitsForThePageItStandsInFor; the already-painted expiry canary and two other tests passed. The screen-dependent fade test skipped.
  • Final head: 39ba84ea217428a0dd1cb12b63005ea06d2c212d; exact-head native suite b6bc8838dbf524477dbfa7a0 timed out at 2400 seconds before the suite began (after restoring web bundles). DEV app build ccaf9a31213b06b773d16c2c completed successfully; artifact SHA-256 c4b51ff0e4aa356bb592d58140f8e45da34257a9cc0d7805c5e962080e677d39.
  • Added regressions cover the unpainted deadline, an already-painted cover's expiry, delayed reveal after frame replacement, and detach with both close/move and park paths.

Observed / Not run

Observed: scoped Swift parse and selected static preflight pass; prepush-gate.py reports no new violations. Independent Codex gpt-6-astra xhigh review is SHIP at 39ba84ea217428a0dd1cb12b63005ea06d2c212d after verifying the stale-reveal and detach repairs. Source and lifecycle review identify the three-second withdrawal and the stale reveal/displacement paths.

Final native focused recovery step 34b1c81373ccfc4e8cabeebc passed at the same exact head on aws-m4pro-2, exit 0: LaunchFirstFrameRevealTests passed in 10 seconds, with one existing no-screen fade test skipped. The original suite attempt timed out before tests. Two isolated DEV capture attempts produced a real seeded mock-pane snapshot and 308 first-launch frames, but the relaunch recorder only captured the disposable launch window; the corrected canonical-workspace attempt stopped yielding an agent pane and subsequent snapshot RPC timed out. Neither attempt is a relaunch retention pass. Published nightly verification remains not run.

Changelog

Fixed - A relaunched chat keeps its last transcript frame until its live page is ready; closed or moved pages release their own covers.

The saved-frame retention fix is verified by the native red-to-green regression, exact-head DEV build and independent review. A real DEV WebKit relaunch restored the same chat in 303 composited frames with zero black frames; this is normal-load WebKit evidence, not a controlled before/after or Chromium proof. The full Chromium relaunch no-black capture follows once capture collects first-second launch frames; fanout-infra owns that collector work and sanitizing the fake-chat fixture. The separate post-handshake loading deadline is fixed in #26161.

Review (Codex gpt-6-astra xhigh): SHIP at 39ba84ea217428a0dd1cb12b63005ea06d2c212d

Agent session: agent session