Repository navigation
fix: bound stalled browser stream startup - #156323
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 25, 2026, 10:11 AM ET / 14:11 UTC (Revision 5). ClawSweeper reviewWhat this changesThe branch gives the Control UI browser stream a bounded startup attempt, cancels a stalled request and socket before screenshot fallback, and adds unit and Chromium browser coverage. Merge readiness✅ Ready for maintainer review Current main still has the reported stream-startup race. The reviewed head addresses it, the newly supplied single-worker timings satisfy the repository’s test-cost disclosure, and this review found no introduced blocker. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI browser panel requests a screencast ticket through the Gateway, then receives browser frames over an auxiliary WebSocket. If startup fails, the panel falls back to a screenshot and schedules another stream attempt. flowchart LR
A[Browser panel opens tab] --> B[Gateway browser request]
B --> C[Screencast ticket]
C --> D[Auxiliary WebSocket]
D --> E{Decoded frame before deadline?}
E -- Yes --> F[Live browser view]
E -- No --> G[Screenshot fallback and retry]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +17, Tests +466. Total +483 across 6 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the startup deadline and cancellation with the panel’s stream-attempt owner while preserving screenshot recovery, static decoded frames, and the server’s existing ticket-authority rules. Do we have a high-confidence way to reproduce the issue? Yes. Current main’s 1.5-second timer can trigger screenshot fallback before a delayed first decoded frame while the stream remains attached; the supplied before-state evidence observes that path. I did not execute current main in this read-only review. Is this the best way to solve the issue? Yes. Bounding the existing stream attempt and forwarding cancellation through its request seam is a focused repair that leaves global RPC timeouts and server ticket policy alone. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against eebf8e4ba1f7. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
d5c4b92 to
2b4bb81
Compare
|
@clawsweeper re-review The unchanged signed head |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
* commit '54b5f23b006ae917c8bb7903f5ee7dad6108ec25': (194 commits) feat(ui): listen to managed desktop audio in the panel (#157724) fix(ci): resume partially published preparation receipts (#158174) feat(release): one approval per release via an attested parent approval receipt (#157911) feat(desktop): advertise current managed desktop audio (#157723) fix(ui): retain delayed progress scroll gestures (#158153) refactor(ui): share sidebar mutation error feedback (#158173) test: await database verifier process lifecycle events (#158171) perf(update): avoid repeated retained-copy parent creation feat(desktop): bind audio streaming to screen authorization (#157722) refactor(gateway): split companion prompts and metadata fixtures (#158050) feat(desktop): isolate managed Linux application audio (#157720) fix(test): prepare catalog fixture modules before startup (#158157) fix: keep model pickers usable during provider sign-in (#158132) refactor(test): remove unused prompt scenario metadata (#158151) fix(ci): unblock Control UI targeted Crabbox gates (#158149) refactor(agents): deslop subagents, sessions, worktrees, commands and auth (#158020) fix: bound stalled browser stream startup (#156323) fix(onnx): prevent worker fixture hangs after release (#158146) fix(models): preserve scoped provider discovery outcomes (#158139) fix(agents): report offline trash failures after agent delete (#158052) ...
* commit '54b5f23b006ae917c8bb7903f5ee7dad6108ec25': (175 commits) feat(ui): listen to managed desktop audio in the panel (#157724) fix(ci): resume partially published preparation receipts (#158174) feat(release): one approval per release via an attested parent approval receipt (#157911) feat(desktop): advertise current managed desktop audio (#157723) fix(ui): retain delayed progress scroll gestures (#158153) refactor(ui): share sidebar mutation error feedback (#158173) test: await database verifier process lifecycle events (#158171) perf(update): avoid repeated retained-copy parent creation feat(desktop): bind audio streaming to screen authorization (#157722) refactor(gateway): split companion prompts and metadata fixtures (#158050) feat(desktop): isolate managed Linux application audio (#157720) fix(test): prepare catalog fixture modules before startup (#158157) fix: keep model pickers usable during provider sign-in (#158132) refactor(test): remove unused prompt scenario metadata (#158151) fix(ci): unblock Control UI targeted Crabbox gates (#158149) refactor(agents): deslop subagents, sessions, worktrees, commands and auth (#158020) fix: bound stalled browser stream startup (#156323) fix(onnx): prevent worker fixture hangs after release (#158146) fix(models): preserve scoped provider discovery outcomes (#158139) fix(agents): report offline trash failures after agent delete (#158052) ...
* fix(qa-lab): retain tab focus and scroll during polling * chore(qa-lab): merge main for tab navigation validation * fix(qa-lab): keep focused tabs visible after layout changes * fix(qa-lab): reconcile navigation retention with current app * chore: refresh main for QA Lab navigation validation * commit '54b5f23b006ae917c8bb7903f5ee7dad6108ec25': (194 commits) feat(ui): listen to managed desktop audio in the panel (#157724) fix(ci): resume partially published preparation receipts (#158174) feat(release): one approval per release via an attested parent approval receipt (#157911) feat(desktop): advertise current managed desktop audio (#157723) fix(ui): retain delayed progress scroll gestures (#158153) refactor(ui): share sidebar mutation error feedback (#158173) test: await database verifier process lifecycle events (#158171) perf(update): avoid repeated retained-copy parent creation feat(desktop): bind audio streaming to screen authorization (#157722) refactor(gateway): split companion prompts and metadata fixtures (#158050) feat(desktop): isolate managed Linux application audio (#157720) fix(test): prepare catalog fixture modules before startup (#158157) fix: keep model pickers usable during provider sign-in (#158132) refactor(test): remove unused prompt scenario metadata (#158151) fix(ci): unblock Control UI targeted Crabbox gates (#158149) refactor(agents): deslop subagents, sessions, worktrees, commands and auth (#158020) fix: bound stalled browser stream startup (#156323) fix(onnx): prevent worker fixture hangs after release (#158146) fix(models): preserve scoped provider discovery outcomes (#158139) fix(agents): report offline trash failures after agent delete (#158052) ... Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
) * fix(qa-lab): retain tab focus and scroll during polling * chore(qa-lab): merge main for tab navigation validation * fix(qa-lab): keep focused tabs visible after layout changes * fix(qa-lab): reconcile navigation retention with current app * chore: refresh main for QA Lab navigation validation * commit '0001f441f53712e44b2ca6edf2a6752b8abd6d1d': (194 commits) feat(ui): listen to managed desktop audio in the panel (openclaw#157724) fix(ci): resume partially published preparation receipts (openclaw#158174) feat(release): one approval per release via an attested parent approval receipt (openclaw#157911) feat(desktop): advertise current managed desktop audio (openclaw#157723) fix(ui): retain delayed progress scroll gestures (openclaw#158153) refactor(ui): share sidebar mutation error feedback (openclaw#158173) test: await database verifier process lifecycle events (openclaw#158171) perf(update): avoid repeated retained-copy parent creation feat(desktop): bind audio streaming to screen authorization (openclaw#157722) refactor(gateway): split companion prompts and metadata fixtures (openclaw#158050) feat(desktop): isolate managed Linux application audio (openclaw#157720) fix(test): prepare catalog fixture modules before startup (openclaw#158157) fix: keep model pickers usable during provider sign-in (openclaw#158132) refactor(test): remove unused prompt scenario metadata (openclaw#158151) fix(ci): unblock Control UI targeted Crabbox gates (openclaw#158149) refactor(agents): deslop subagents, sessions, worktrees, commands and auth (openclaw#158020) fix: bound stalled browser stream startup (openclaw#156323) fix(onnx): prevent worker fixture hangs after release (openclaw#158146) fix(models): preserve scoped provider discovery outcomes (openclaw#158139) fix(agents): report offline trash failures after agent delete (openclaw#158052) ... Co-authored-by: Vincent Koc <[email protected]>
* fix(ui): release failed avatar response bodies * test(ui): cover avatar response cancellation in Chromium * test(ui): assert retained image after avatar failure * test(ui): preserve window global type in avatar proof * test(ui): avoid shadowed avatar proof bindings * chore: refresh main for avatar lifecycle validation * commit '54b5f23b006ae917c8bb7903f5ee7dad6108ec25': (175 commits) feat(ui): listen to managed desktop audio in the panel (#157724) fix(ci): resume partially published preparation receipts (#158174) feat(release): one approval per release via an attested parent approval receipt (#157911) feat(desktop): advertise current managed desktop audio (#157723) fix(ui): retain delayed progress scroll gestures (#158153) refactor(ui): share sidebar mutation error feedback (#158173) test: await database verifier process lifecycle events (#158171) perf(update): avoid repeated retained-copy parent creation feat(desktop): bind audio streaming to screen authorization (#157722) refactor(gateway): split companion prompts and metadata fixtures (#158050) feat(desktop): isolate managed Linux application audio (#157720) fix(test): prepare catalog fixture modules before startup (#158157) fix: keep model pickers usable during provider sign-in (#158132) refactor(test): remove unused prompt scenario metadata (#158151) fix(ci): unblock Control UI targeted Crabbox gates (#158149) refactor(agents): deslop subagents, sessions, worktrees, commands and auth (#158020) fix: bound stalled browser stream startup (#156323) fix(onnx): prevent worker fixture hangs after release (#158146) fix(models): preserve scoped provider discovery outcomes (#158139) fix(agents): report offline trash failures after agent delete (#158052) ... * test(ui): wait for settled avatar fallback * test(ui): wait for control UI before avatar handoff * fix(ui): preserve avatar cleanup across retry lifecycle updates Integrate current main while preserving retry exhaustion, auth restoration, and deferred response cleanup. Keep the real-stream test on real timers and drain loader cleanup before restoring shared test state. * fix(ui): integrate avatar response cleanup with current main * test(ui): align avatar cleanup proof with current harness * test(ui): qualify avatar cleanup harness types and formatting Co-authored-by: Vincent Koc <[email protected]>
* fix(ui): release failed avatar response bodies * test(ui): cover avatar response cancellation in Chromium * test(ui): assert retained image after avatar failure * test(ui): preserve window global type in avatar proof * test(ui): avoid shadowed avatar proof bindings * chore: refresh main for avatar lifecycle validation * commit '0001f441f53712e44b2ca6edf2a6752b8abd6d1d': (175 commits) feat(ui): listen to managed desktop audio in the panel (openclaw#157724) fix(ci): resume partially published preparation receipts (openclaw#158174) feat(release): one approval per release via an attested parent approval receipt (openclaw#157911) feat(desktop): advertise current managed desktop audio (openclaw#157723) fix(ui): retain delayed progress scroll gestures (openclaw#158153) refactor(ui): share sidebar mutation error feedback (openclaw#158173) test: await database verifier process lifecycle events (openclaw#158171) perf(update): avoid repeated retained-copy parent creation feat(desktop): bind audio streaming to screen authorization (openclaw#157722) refactor(gateway): split companion prompts and metadata fixtures (openclaw#158050) feat(desktop): isolate managed Linux application audio (openclaw#157720) fix(test): prepare catalog fixture modules before startup (openclaw#158157) fix: keep model pickers usable during provider sign-in (openclaw#158132) refactor(test): remove unused prompt scenario metadata (openclaw#158151) fix(ci): unblock Control UI targeted Crabbox gates (openclaw#158149) refactor(agents): deslop subagents, sessions, worktrees, commands and auth (openclaw#158020) fix: bound stalled browser stream startup (openclaw#156323) fix(onnx): prevent worker fixture hangs after release (openclaw#158146) fix(models): preserve scoped provider discovery outcomes (openclaw#158139) fix(agents): report offline trash failures after agent delete (openclaw#158052) ... * test(ui): wait for settled avatar fallback * test(ui): wait for control UI before avatar handoff * fix(ui): preserve avatar cleanup across retry lifecycle updates Integrate current main while preserving retry exhaustion, auth restoration, and deferred response cleanup. Keep the real-stream test on real timers and drain loader cleanup before restoring shared test state. * fix(ui): integrate avatar response cleanup with current main * test(ui): align avatar cleanup proof with current harness * test(ui): qualify avatar cleanup harness types and formatting Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
A browser stream that takes longer than 1.5 seconds to start can trigger screenshot fallback while its original stream attempt is still alive. A stalled mint, socket opening, ready message, or first usable frame can leave that attempt attached indefinitely.
User Impact
Slow browser streams get one bounded startup attempt. If startup cannot finish, its local request and socket retire before the existing screenshot and recovery path takes over. A successfully decoded static frame remains valid without requiring recurring traffic.
Why This Change Was Made
Use the existing 30-second operation budget at the stream-attempt owner, spanning mint through first usable decoded frame. Forward its timeout and AbortSignal through the existing browser request seam. Keep the established 10-second recovery path, last-good image, semantic close handling, and route/client/frame ownership fences.
Production LOC: +26/-9 (net +17) | Tests: +488/-22 (net +466). Two production owners and four connected test/support files. No global RPC timeout, server token policy, protocol, or periodic frame watchdog change. Local cancellation does not claim to revoke a ticket already minted remotely.
Current-Head Reconciliation
Signed head:
2b4bb8156d8b3c97c62c4d6fc90204d995ce9fd3, refreshed onto mainfef6b1290e412761888865da5b61ee1c0ce29586after GitHub reported a merge conflict.The two production files introduce the same added/removed code as the earlier reviewed patch. Main's session-scoped dashboard routing,
forgetNavigationcontract and direct URL-editing property are preserved. The only manual conflict resolution keeps the test client's session-scoped method selection together with typed request options; no timing bound, assertion or security guard was weakened.Fresh complete-candidate AutoReview, including the request lifecycle, snapshot owner, stream client and test context, passed with no actionable P0-P3 findings. Exact-head CI completed successfully on September 24 at 05:41 UTC. ClawSweeper Revision 4 found no actionable patch defect; it has no before-merge findings. Explicit single-worker costs required by the repository are now recorded below; review and CI freshness still need native qualification. Previous-head CI remains historical evidence.
No tests, builds, formatters or checks were run on the local Mac. The final section preserves historical source/browser evidence and images from the previous
d5c4b92a664f6aa053afd9cbe62c4bd4c48d115fcandidate. Current-head execution is distinguished in the single-worker and hosted evidence sections below.Single-Worker Cost Proof
On September 25, the unchanged signed head passed these commands on Linux Blacksmith Testbox with Node 24.19.0, pnpm 12.4.2, and runnable Chromium. Each command was
pnpm test <file> --maxWorkers=1; source tree8bbf8eb51b5d47fac943d0946a3a9377208e2544, all six changed-file SHA-256 pins and exact single-file routing were verified first.ui/src/components/browser/browser-panel-stream-startup.test.tsui/src/components/browser/browser-panel-stream.test.tsui/src/e2e/browser-stream-startup.e2e.test.tsAll three children exited 0 and remain below the 30-second file budget. The clocks include native test startup and the E2E UI build, but exclude source transfer, dependency preparation and Chromium installation/preflight. The unit commands route through
test/vitest/vitest.ui.config.ts; the browser command usestest/vitest/vitest.ui-e2e.config.tsand exercises the actual Chromium/WebSocket/decoded-frame boundary.Completed Testbox run 36144348521: wrapper
exitCode: 0,runStatus: succeeded, native lease status completed. The portal-sync timeout warning concerns terminal reporting, not application proof; it was not retried. Actions cancellation during one-shot cleanup is not a failed application test or a replacement for required exact-head CI. Retained full capture SHA-256:4d5d37dff7955a992dc141402790990d595be0d34cfddf4dd48fe98229f1d45d.The earlier hosted job/step seconds below remain the CI-cost evidence. These new standalone measurements close the one-worker process-wall gap; shared CI job duration is not marginal PR cost.
Exact-Head Hosted Evidence
ui/src/components/browser/browser-panel-stream-startup.test.tsui/src/components/browser/browser-panel-stream.test.tsui/src/e2e/browser-stream-startup.e2e.test.tsThe UI job took 297 s overall and 211 s in
Test Control UI. Both unit files ran in the Bun partition ofui/vitest.config.ts, with--maxWorkers 3, native shard3/3and plan concurrency 1. The shared suite passed 498 files / 8,349 tests with no skips.The E2E job took 435 s overall and 378 s in
Test Control UI end-to-end. It used the repository Vitest wrapper,test/vitest/vitest.ui-e2e.config.ts,--maxWorkers 3, and shard7/8; the workflow displays this as7/9because of its separate extension job. The shared suite passed 79 files / 367 tests with no skips.Timing limits: the unit elapsed values are
endEventAtMs - queuedEventAtMsfrom the existing[vitest:module]receipts, not standalone invocation startup. Environment/prepare fields are separate and are not added to those values. These are observed hosted costs, not a separately pinned one-worker benchmark. Shared job and step seconds include other files and setup; they are not incremental PR cost. The E2E file's real browser/WebSocket/decoded-frame behavior is the boundary the owner-only unit tests cannot establish. No additional test execution was needed to recover these logs.Historical Source and Browser Evidence
The browser proof uses real Chromium, real auxiliary WebSocket messages, and actual JPEG decoding, with a synthetic control Gateway and mint/screenshot responses. It is not deployed or external-Gateway verification. Matched original/final captures show the held-first-frame boundary: the original sends one redundant screenshot request after 1.5 seconds while its auxiliary stream remains alive; the fix retains the existing loading skeleton without a screenshot request. Both then decode the same JPEG and show the same usable page with no browser errors. This avoids competing fallback during the established startup budget; it does not claim earlier pixels.
Provenance: the previous first-frame race was introduced in PR #141031 (
a7175b2a), authored and merged by @steipete.