webviews: agent-pane-seen waits for a slow first attach (no bead)

Merged
TE
25d ago
+49-29

Summary

agent-pane-seen.test.ts went red on unrelated feat-cmux-next PRs: #19881, #19883, #19885 and #19831 in the last 6 h, 4 of the last 10 react-apps-check runs. Both cases failed together:

  • the pane tells acpmux whether it shows its chat: attach undefined at line 132. The test gave the first page 10 s to attach. Since #19831, dev server files run side by side, and on a busy runner the first page's cold modules load slowly, so its attach came later than that.
  • a pane hidden while its attach is in flight …: a knock-on failure. The first case threw before closing its page, so that page's late attach took the second case's held attach slot.

Fix:

  • The first attach gets 60 s; later waits keep their 10 s.
  • Each case closes its page even when it fails, so one failure can't cascade into the next case.
  • Red test: the stand-in daemon answers the first initialize after 11 s, reproducing the slow first page.

Testing

  • Red then green in this PR's react-apps-check: the red commit adds only the 11 s cold start.

Changelog

none

🤖 Generated with Claude Code


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


Summary by cubic

Stabilizes the agent-pane-seen.test.ts flake on busy CI runners, where the first page's attach could arrive after the 10 s wait and its unclosed page would then steal the next test case's held-attach slot.

  • The first attach now gets 60 s; later waits keep their 10 s.
  • Each test case closes its page on failure, so one failure can't cascade into the next.
  • The red commit reproduces the slow cold start by answering the first initialize after 11 s.