Repository navigation
fix(ui): keep expanded Swarm results open during refresh - #154170
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 changes before merge. Reviewed September 20, 2026, 8:37 PM ET / September 21, 2026, 00:37 UTC (Revision 3). ClawSweeper reviewWhat this changesThe shared session-row observer retains the current descriptor during rejected stale refreshes so expanded Swarm results stay open, with a deterministic regression test. Merge readiness⛔ Needs changes before merge - 1 item remains This remains a useful, focused fix: current main still clears the descriptor when rejecting a stale read. The patch preserves lifecycle checks, has convincing visual evidence, and introduces no actionable correctness finding. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI turns Gateway session responses into observed rows that feed Swarm cards showing child-run results. Clearing an observed parent temporarily removes its card and loses the reader’s expanded state. flowchart TD
A[Gateway session responses] --> B[Shared row observer]
C[Session invalidation events] --> B
B --> D{Read still current?}
D -->|Yes| E[Publish fresh descriptor]
D -->|No| F[Retain held descriptor]
E --> G[Swarm roster and expanded card]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +2, Tests +60. Total +62 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep stale-read rejection within the shared observer while preserving the held presentation until a fresh descriptor, explicit removal, or session replacement arrives. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the ordering: a list issued before invalidation settles before the fresh descriptor, publishes null, and empties the Swarm roster. The PR supplies a failing-before regression and controlled browser comparison; this review did not execute them. Is this the best way to solve the issue? Yes, retaining the already accepted descriptor at the observation owner is narrower than adding disclosure restoration logic to the renderer, and leaves explicit clearing and retirement intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2969f4becc06. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
What Problem This Solves
Fixes expanded completed Swarm results unexpectedly closing when an older session-list response arrives during a refresh.
User Impact
Readers can keep the completed child-run details open while the parent finishes. Explicit removal and session replacement still clear the old row. No configuration, storage, or permission changes are required.
Why This Change Was Made
The shared session-row observer correctly rejects reads issued before a later invalidation, but treated that rejection as an absent row. It notified the Swarm roster with
null, unmounted the disclosure, then recreated it closed when the fresh descriptor arrived. Retain the current descriptor for a rejected non-null read; explicit absence and successor retirement keep their existing paths.The component already keys disclosures by group identity. The fix belongs to the row-observation owner, before rendering, and leaves the lifecycle E2E assertions and all timeouts unchanged.
Evidence
Sighting: PR CI run 35539662247, job 106155028238, from the CI-planner-only change #153962. The mobile case failed after 16.3 seconds, following the passing desktop-many case. Captured diagnostics show connection epoch
1throughout, parentdone/inactive at revision3, correct final-outcome text, anddetailsSame:false/detailsOpen:false. The displayed job was10/13; its actual invocation selected shard10/12.The earlier fixes in #153277 and #153168 explicitly left this race unresolved.
expected null to deeply equal initial, then passes with the fix. It also verifies admission of the fresh settled parent.tbx_01m30dw6bnxj7r3208dyjjygq4(environment run), through Crabbox, uses Node 24.19.0 and managed Playwright Chromium 153.0.8010.12 (revision 1243), installed with--require-playwright-chromium. The lease was stopped after all proof commands completed successfully. The original logged 39-file shard passes 256 cases. The diagnostic baseline file campaign passes 20/20 runs (140 cases), so the natural visibility-failure rate was 0/20 on this lease. The trace still caught the passing mobile case in baseline run 2 publishingapplyParent(null)and empty rows before the fresh parent arrived, on the same pane and connection. That run refilled before rendering could unmount the disclosure; the captured invalidation/list/descriptor ordering establishes the race beneath the intermittent assertion.OPENCLAW_VITEST_MAX_WORKERS=8with the E2E config’s existing two-worker policy; the original shard inventory is supplied throughOPENCLAW_VITEST_INCLUDE_FILE.node scripts/check-changed.mjspasses, including core/UI typechecks, type-aware lint, dead-export scans, and applicable guards. Formatting andgit diff --checkpass; a type-aware lint canary correctly rejects an unhandled promise.First hosted CI attempt: run 35545824271, head
d98e924a674266c433f99478d13cd13daf177111, completed with 111 successful jobs, 13 skipped jobs, and two failures:checks-node-compact-small-46and its aggregateopenclaw/ci-gate. No job was rerun.The Node failure is
test/scripts/release-check.test.ts→ “loads sparse release tooling and checks the target worker contract,” which exceeded its unchanged 120-second limit after 120.057 seconds. This release-tooling fixture launches the real checker 16 times plus an import probe and Git inventory; each checker performs npm tarball inspection before checking the worker contract. The log has no child-step progress, so it does not establish which invocation or accumulated cost exhausted the budget. This PR changes neither that fixture nor its checker. The earlier fixture repair #153884 is already present. The CI-planner PR cited in the sighting remains open and would route this maintainer-tooling composition out of product-only PRs; it is a routing fix in flight, not proof that the underlying timeout is repaired. This PR remains unmerged with that CI blocker recorded.The attached before/after screenshots show the inspected synthetic mobile card after parent settlement. Before: the refreshed card closes and hides its result. After: the same card remains expanded with the final outcome and child details visible.