Repository navigation
fix(browser): recover stale panel after stream disconnects - #141576
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. |
5a2746c to
d51af6f
Compare
|
Codex review: needs maintainer review before merge. Reviewed September 7, 2026, 7:00 PM ET / 23:00 UTC. ClawSweeper reviewWhat this changesThe Browser panel automatically refreshes screenshots and reconnects failed streams while preserving annotation and inspection images and deferring resize restarts. Merge readiness✅ Ready for maintainer review This PR remains useful: current main still lacks automatic recovery after an established stream disconnects. Both earlier findings are addressed, the supplied Chromium evidence demonstrates recovery, and no blocking defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI Browser panel displays streamed frames or fallback screenshots from the selected browser tab. Its stream and snapshot controllers coordinate reconnects, image ownership, and capture modes. flowchart TD
A[Selected browser tab] --> B[Browser stream]
B --> C{Connection lost}
C --> D{Interaction mode}
D -->|Yes| E[Screenshot fallback and delayed reconnect]
D -->|No| F[Preserve captured image]
F -->|Exit capture mode| E
E --> G[Updated Browser panel]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +70, Tests +201, Docs +4. Total +275 across 4 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep recovery in the stream lifecycle owner, with bounded retries, preserved in-flight screenshots, and capture-mode-aware restarts. Do we have a high-confidence way to reproduce the issue? Yes: terminate an established screencast while the Gateway client remains available and observe the absence of automatic recovery on current main. Source inspection supports the supplied Chromium baseline; this review did not execute it. Is this the best way to solve the issue? Yes: the patch repairs the existing stream owner and reuses screenshot fallback and backoff, while addressing both previously reported lifecycle races. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 80dc985ed386. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
d51af6f to
d05d51d
Compare
|
Reviewed
Please add regression tests for both sequences. These are statically traced findings, not independently executed reproductions. Inspected CI, attempt 1: 33 stream tests passed; a separate chat-image E2E test failed. A causal relationship with this PR has not been established. |
…ecovery A recovery retry reconnects the stream directly and requests a new screenshot only when none is in flight, so a failed reconnect no longer discards a pending fallback screenshot. A large width change during annotation or inspection keeps the stream open; the restart waits until interaction mode resumes.
|
Both findings are fixed in 68e57c9.
Three regression tests cover both sequences. All three failed on d05d51d before the fix. Locally, 202 browser panel tests, lint, the UI typecheck, and the import-cycle check pass. The Chromium proof passed again on the new head; the PR body carries the updated trace. The |
|
Thanks @safzanpirani! Proof: The production Control UI Browser panel was exercised in Chromium with a real disposable WebSocket and synthetic Gateway responses. The complete browser outcome was checked without a manual refresh.
|
…141576) Recover the Browser panel after an established screencast disconnects by requesting a fallback screenshot and retrying the stream through the existing backoff. Keep pending screenshots valid during failed reconnects. Preserve annotation and inspection images, then resume deferred recovery and resize restarts when interaction mode returns. Fixes openclaw#141564. Co-authored-by: Ayaan Zaidi <[email protected]>
…1-prep * commit 'da37d47920d102044a4cb33f8cd688b4abc3c2a6': (460 commits) refactor(memory): simplify built-in runtime delegation (openclaw#141847) refactor(comfy): remove unused cloud fixture input (openclaw#141844) fix(agents): keep canonical target casing for session-bound replies (openclaw#140418) fix(ci): hydrate release source ancestry through branch (openclaw#141840) fix(telemetry): include mixed-case configured providers (openclaw#141134) fix(qa): retain Slack presentation history (openclaw#127300) test(cli): compact argv case matrices (openclaw#141832) test(agents): compact code mode case matrices (openclaw#141831) test(gateway): compact control ui routing cases (openclaw#141834) test(reasoning): compact reasoning tag cases (openclaw#141833) fix(cli): keep progress spinners within terminal width (openclaw#141401) fix(release): provision native live harness dependencies (openclaw#141829) fix(cron): preserve prepared runtime and error ownership (openclaw#140941) fix(npm): recognize companion-owned runtime imports (openclaw#141647) fix(browser): reject unsupported buttons in click commands (openclaw#140976) refactor(gateway): keep cached turn replay with dedupe (openclaw#141824) fix(release): preserve frozen gateway package resolution (openclaw#141827) refactor: keep live image probe matching private (openclaw#141823) fix(browser): recover stale panel after stream disconnects (openclaw#141576) feat(cron): explain slow automation list requests (openclaw#141805) ...
Closes #141564
What Problem This Solves
Fixes an issue where the Browser panel would keep displaying a stale image after an established screencast connection failed. The Gateway client could remain available while the panel requested neither a screenshot nor a replacement stream.
Why This Change Was Made
The stream owner now requests screenshot fallback and retries streaming through its existing ten-second backoff. Recovery cancels when ownership changes. The screenshot controller preserves captured annotation and inspection images.
Review follow-up in
68e57c98:User Impact
The panel recovers without a refresh, resize, or navigation action. Users can finish annotating or inspecting their captured image and return to interaction mode to resume streaming, including after resizing the panel.
Evidence
d05d51d6before the fix.git diff --checkpass.check:madge-import-cyclesreports zero cycles.The Chromium fixture loads the production Browser panel and terminates a real disposable WebSocket connection. Gateway request responses are synthetic; this does not test a real Gateway backend.
6312673668e57c98The timing values describe one fixture run. No manual refresh occurs.
A socket that stays open without sending its first frame remains outside this fix. The independent review of the follow-up commit flagged the same case; it behaves as it did on the previous head and on
main.The
checks-ui-e2e (7/13)failure ond05d51d6waschat-flow.image-handoff.e2e.test.ts, which this change does not touch.AI-assisted implementation and review.