Repository navigation
fix(ui): recover sessions and dashboards after prolonged outages - #115654
Conversation
d3acbcb to
5c07d88
Compare
23f87b3 to
ac73a8b
Compare
ac73a8b to
bf656dd
Compare
|
Codex review: needs maintainer review before merge. Reviewed July 29, 2026, 9:20 AM ET / 13:20 UTC. ClawSweeper reviewWhat this changesRepairs Control UI recovery after long Gateway outages by bounding browser connection timers, retiring stale listeners and catalog data, pausing offline dashboard retries, releasing detached chat subscriptions, and sharing pairing-QR expiry ownership; it also updates generated-asset lint planning and browser-runtime output. Merge readinessThis PR remains necessary: it adds bounded reconnect, event-delivery, catalog, dashboard, subscription, and pairing-QR lifecycle handling that is present on the proposed branch, not shown as merged into current Likely related people: Priority: P1 Review scores
Verification
How this fits togetherThe browser Gateway client turns a WebSocket connection and Gateway events into Control UI state for chat, session catalogs, dashboards, and pairing flows. This PR changes the lifecycle boundaries between transport reconnects, event subscribers, and UI-owned timers so disconnected or replaced resources do not continue affecting visible state. flowchart LR
A[Gateway WebSocket] --> B[Browser Gateway client]
B --> C[Handshake and heartbeat lifecycle]
B --> D[Event subscription delivery]
C --> E[Control UI connection state]
D --> F[Session catalog and chat panes]
E --> G[Dashboard refresh behavior]
F --> H[Visible recovered UI]
G --> H
Decision needed
Why: The patch spans shared browser transport behavior, multiple Control UI state owners, generated browser output, and check planning; the Before merge
Agent review detailsSecurityNone. PR surfaceSource +253, Tests +850, Other +28. Total +1131 across 32 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase or merge-update the branch, retain the bounded lifecycle ownership and regression coverage, then land only after the exact merge-result checks confirm the same reconnect and UI recovery behavior. Do we have a high-confidence way to reproduce the issue? Yes, with medium confidence: the PR documents a pinned failing baseline and focused reconnect, heartbeat, catalog, retry, and timer scenarios, but this read-only review did not independently execute them against current main. Is this the best way to solve the issue? Yes, provisionally: the patch places transport timing and event retirement in the shared browser Gateway owner while leaving dashboard, catalog, chat, and media-specific recovery in their UI owners; the remaining question is whether maintainers want its broad landing scope kept together. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8ec4a059fc69. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…nclaw#115654) * fix(ui): recover long-running sessions and dashboards * fix(ui): expose browser-safe gateway timers * refactor(ui): keep browser timer surface minimal * refactor(gateway): extract pending request state * fix(ci): refresh browser runtime and format baseline * fix(ci): exclude generated plugin outputs from targeted lint * fix(ui): bound long-running connection and pane lifecycles * refactor(ui): split long-running lifecycle regression coverage * fix(ui): bound long-running media and lint ownership * fix(security): preserve explicit workspace disable denylist * fix(ci): preserve plugin manifest fallback lint
What Problem This Solves
Fixes issues where people using the Control UI could see apparently connected but permanently stalled sessions, receive stale dashboard events after reconnect, retain session actions after the Gateway revoked their catalog, continue retrying offline dashboard requests, or keep expired pairing QR codes and timers alive across split panes. Also fixes a real-browser media-cache regression test that could fail when concurrent image downloads completed in a different order.
Why This Change Was Made
Stress testing against an exact
mainrevision exposed lifecycle failures missed by ordinary reconnect scenarios. Keep heartbeat recovery and safe timer bounds in the browser Gateway owner, stop delivery when an event retires its connection or subscription, preserve legitimate long-running requests, pause automatic dashboard retries while preserving one explicit user refresh, revoke catalogs only after an authoritative replacement hello, and reuse the existing shared media-resource owner for pairing-QR expiry instead of maintaining a separate timer registry. The real-browser mocked Gateway now emits and cleans up its advertised heartbeat, and the media-cache proof identifies the actual asynchronously created least-recently-used image.The full merge-gate proof also uncovered a generated-asset infrastructure failure. Make changed-file lint planning discover generated browser assets from each plugin's existing manifest and leave those assets to the authoritative bundled-asset check; continue linting every changed plugin source. Regenerate the committed browser runtime from its canonical entry point. The latest rebase deliberately drops the superseded matrix-evidence workaround now that
mainowns that code.User Impact
Chat, Workboard, session sidebars, and pairing flows recover reliably from silent disconnects and prolonged outages. Disconnected dashboards stop consuming background requests without losing explicit refreshes, split panes expire QR codes together, stale or unauthorized catalog actions disappear without clearing valid sessions during a transient reconnect, and real-browser image-cache coverage no longer depends on concurrent download order.
Evidence
9c118dd38f5424d826c99413d3e48e919f3aa449.build-artifacts.pnpm plugins:assets:checkpasses against every committed bundled plugin asset.pnpm check:changedpasses formatting, all owner typechecks, targeted lint, dead-export scans, plugin boundaries, import cycles, runtime policy, and declaration contracts.pnpm buildpasses bundled assets, all 146 public plugin SDK exports, the packaged Control UI, all 682 precompressed UI sidecars, and the Control UI performance budget.mainrebase: 5 consecutive passing runs; 8 end-to-end files and 35 tests per run, 175 passing browser tests total, covering Gateway/session reconnect, dashboards, revoked catalogs, sidebar recovery, attachments, plan replay, 65 concurrent images, Blob revocation, LRU eviction, and authenticated refetch.main:check-test-typesreports an unused matrix-validator import;check-dependenciesreports the unusedCodeModeFailurePhaseexport in agent-runtime code;checks-node-compact-small-1reports a QA workflow test expecting 60 minutes although the workflow now specifies 90. These are outside the Control UI change and are not bypassed or silently fixed in this PR.Final extended stress proof
2e04d862c18eefcc0792ede13784c61c363ec833.OPENCLAW_DISABLE_explicitly denied and workspace plugin controls still fail-closed.origin/main; the exact reviewed/tested head is intentionally frozen rather than repeatedly rebased whilemainmoves. The native merge workflow rechecks the latest mainline, merge conflicts, head identity, and required checks immediately before landing.