Repository navigation
fix(control-ui): retire deleted sessions once without wiping cached sidebars - #189729
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. What this changesThis PR adds regression coverage for repeated deletion broadcasts, sidebar preservation, and record-local corruption recovery. Example: Delete agent:main:cedar while agent:main:retained remains cached.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review Keep this PR open as an explicitly paused regression experiment: current source supports its reported failures, but it intentionally includes no production repair. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI consumes Gateway deletion receipts, retires browser snapshot state, and restores cached sidebar and conversation displays on reload. flowchart TD
A[Gateway session publications] --> B[Shell retirement owner]
A --> C[Chat pane observation]
B --> D[Snapshot invalidation]
C --> D
D --> E[IndexedDB snapshots]
E --> F[Cached reload presentation]
Technical reviewBest possible solution: When the owner resumes work, repair the existing retirement and snapshot owners to remove deleted display copies once while retaining unrelated valid caches. Do we have a high-confidence way to reproduce the issue? The added regressions reach the production pane and snapshot owners, whose source explains the reported outcomes; baseline failures are author-reported and were not independently executed. Is this the best way to solve the issue? The tests isolate distinct failures using existing fixtures and owners, but this experiment is a diagnosis rather than a completed solution. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4ade7ee96f86. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceTests +66. Total +66 across 3 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 31, 2026, 4:13 PM ET / 20:13 UTC. |
87605d2 to
9745d68
Compare
9745d68 to
e4deb6e
Compare
e4deb6e to
342e132
Compare
342e132 to
91ba31c
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
91ba31c to
d0e9afe
Compare
Keep confirmed deletion retirement at the shell owner and remove the pane's replay path. Prune deleted rows across saved, prewarmed and displayed sidebars instead of retiring the account projection. Suppress unchanged handoff, roster receipt and cross-tab writes; evict malformed conversation records individually. Regression proof covers repeated roster publications, scoped privacy pruning, independent tab writers, corruption isolation and native two-tab churn with cached reload.
Prune nested rows in one pass without the temporary filtered list, retaining immutable shared snapshot rows. Check the IndexedDB spy receiver before reading its store name and allocate the exact regression test-line delta. Static review remains clean through P2. The lane stays blocked on the separate boot first-paint gate; no performance-gate clearance is claimed.
Resolve the remaining targeted lint findings with an explicit pending write and a distinct churn callback variable. The complete repair tree passes 130 focused tests, both typechecks, targeted lint, UI build and native two-tab deletion checks. The campaign first-paint gate remains blocked; no landing clearance is claimed.
d0e9afe to
080142d
Compare
…idebars (openclaw#189729) Session deletion receipts no longer replay into every chat pane or clear whole cached sidebar displays. Each deleted session is pruned once from the sidebar snapshot model (pins, pages, entries, section counts and roster), from IndexedDB records and from boot/prewarm reads; unrelated cached sidebars and transcripts stay intact. A malformed transcript record is now discarded on its own instead of resetting the whole snapshot database, and unchanged sidebar captures skip their write. Storm proof: invalidation broadcasts 25/5 -> 1/1, zero sidebar wipes over two virtual minutes, no deleted-row resurrection, writes only for meaningful changes.
What Problem This Solves
Repeated publications of an already-confirmed session deletion caused each mounted chat pane to invalidate the same snapshot again. In a real isolated Gateway with two browser tabs and 20 unrelated roster publications, the tabs broadcast 25 / 5 invalidations for one deleted session. Each event also retired the entire cached sidebar, including unrelated conversations.
The repair produces 1 / 1 broadcasts, preserves the sidebar through two virtual minutes of churn with zero wipes, removes the deleted row from cached reloads, and writes the sidebar only when its display model changes.
Why This Change Was Made
The shell already retires each confirmed deletion. Remove the competing pane replay instead of adding another deletion-deduplication owner. A single canonical pruning helper removes the deleted session and its nested rows, navigation references, and boot-roster entry. Display, in-flight prewarm, IndexedDB, and the already-published boot roster consume that operation within their existing lifetimes; account/scope retirement still clears the whole projection.
History: #125128 made the pane's replayed cache deletions observable by the persistent snapshot owner. #168206 extended one session's invalidation to the entire sidebar projection. This is amplification of those existing paths, not an identified post-r241 introducer.
Two associated owner fixes remain: malformed individual conversation/board/history records evict only that record instead of resetting the entire database; identical sidebar models skip duplicate cross-tab writes, and roster receipt
tsdoes not count as a display change. These are plausible contributors to the live three-record chat cache and write churn, not proof of their exact live causes. Real two-tab probes observed zero whole-database resets; aggregate corruption, I/O recovery, account retirement and projection-version eviction remain separate paths.User Impact
Deleting one conversation removes it without emptying the rest of the cached sidebar. Unrelated conversations remain available on reconnect and reload, and a deleted conversation does not return from the cache. Unchanged roster publications and cached-to-live handoff do not keep rewriting the sidebar.
This PR does not fix the chat route's first-frame blank/skeleton or claim seamless complete first paint. That separate admission/paint-holding work belongs to the other reload lanes. No new configuration, Gateway protocol, server schema, or retention policy.
Evidence
All browser fixtures and media are synthetic; no private capture content is included.
The native write bound is 1 write / 2 virtual minutes for normal deletion and 2 / 2 for a subagent (0.5/min and 1/min), with no further writes during churn. The observed live baseline was 71 writes / 183 seconds (23.3/min). These are different workloads, so this is a deterministic work-count bound, not a paired wall-clock speed claim.
Validation
Final head:
080142de4798fb81e869ab509110c8d8bd1420d1(rebased base1440bb1771372334bea23d7642bb52deb7db1845). Independent Codex review is clean through P2; range-diff preserved all seven patches. Exact-head CI is green.AWS lease
cbx_27e1468e115e, fixedc7a.4xlarge(16 vCPU / approximately 31 GiB), final-head validation run:[1,0]/[2,0]node scripts/check-changed.mjsFour of those six file failures were setup errors: my initial payload installed Chromium but omitted WebKit. After installing WebKit, all four files passed individually on the same final head:
logs-scroll(3 tests),tooltip-first-activation(2),chat-composer-picker-layout(4), andworkboard-native-bundle(4). This resolves 13 of the 17 skipped cases; the remaining four cases retain their existing opt-in proof, live-provider, or desktop-fixture requirements. This is a full run plus focused setup repairs, not a claim that the original full invocation was green.Follow-up proof and main controls, same AWS lease: both actual failing cases reproduce on freshly fetched main
17e2d54e2fbea1161bb8da5a3bbb6a9a35214d3awith the same errors:chat-outbox-migration.e2e.test.ts: preserves qualified/global v3 Blobs through migration, reload and retriesextensions/qa-lab/src/control-ui-automation-management.real-gateway.e2e.test.ts: configured owners/admin manage a Telegram-created jobThe full-tree unused-export scan reports
DATABASE_SNAPSHOT_FREE_SPACE_RESERVE_BYTESandMAX_DATABASE_SNAPSHOT_EXTRACT_BYTESfrom untouchedsrc/commands/backup-verify-spool.ts. Current main's scan passes. The same two findings reproduce on recorded base1440bb1771372334bea23d7642bb52deb7db1845(base control); they are inherited from the base and fixed since on current main. No scan bypass was used.The final startup comparison is 89,492 B gzip versus base 89,313 B (+179 B), three requests in both arms, with the 89,930 B enforcement limit unchanged. Earlier CI found two attributable import-boundary failures: static schema imports added 3,553 B, then stored dynamic module imports exceeded the manual-import ratchet. Both are repaired: utility reads are destructured, schema loading happens on deletion before opening the IndexedDB transaction, and prewarm retains only its derived snapshot promise. No budget waiver, loader helper, new owner, or baseline allowance.
Earlier real-Gateway proof: AWS
cbx_0c8b568d76c3, baseline, repair.Changed-test command costs (
pnpm test <file> --maxWorkers=1, one file per command):sidebar-snapshot.test.ts4.42 s;chat-pane-session-presentation.test.ts5.85 s;session-snapshot-store.test.ts2.83 s;sidebar-snapshot-store.test.ts2.82 s. The final-head remote focused command covers these four plus the existing prewarm and invalidation suites: 6 files / 130 tests, 13 s. The native two-case command takes 38 s on the final-head AWS box. These are validation costs, not performance comparisons.Bounded simplification and LOC
The bounded compression pass retained the original +173 runtime lines. Required CI repairs to the import boundary bring the final change to +177 runtime LOC (+179 under the requested diff-stat filter, which includes the two-line allocation file). It did not reach +130 without weakening a proven lifecycle/privacy behavior. Boot already re-reads the pruned prewarm model; IndexedDB, display, and prewarm already use the same pruning helper. Adding a coordinator merely to combine their lifetime adapters would create another owner.
sidebar-snapshot-data.tssidebar-snapshot.tssession-snapshot-database.tssession-boot-snapshot.tssession-snapshot-prewarm.tssession-snapshot-invalidation-events.tssession-sidebar-snapshot.tssession-snapshot-store.tssidebar-snapshot-capture.tschat-pane-session-observation.tsTest audit consolidated the parameterized native regression from 274 to 240 lines by sharing native IDB instrumentation, row lookup and probe readout. Both session shapes and all storage-event, churn, privacy, write and reload assertions remain. Reaching 180 would trade away the real native instrumentation or compress the required auth/roster/bootstrap fixture into less readable code. No new production test seam or exported helper. Exact test-line allocation: 358, reduced from 392; no slack. Five test files plus the offline/reconnect documentation accompany the ten runtime files.
Synthetic before/after reload
Repaired live sidebar immediately before warm reload, then cached sidebar after reload with connect held. These prove survivor retention and deleted-row absence; they do not claim first-paint completeness.