Skip to content

fix(ui): keep expanded Swarm results open during refresh - #154170

Merged
steipete merged 2 commits into
mainfrom
ci-burden/f48-swarm-mobile
Sep 21, 2026
Merged

steipete merged 2 commits into
mainfrom
ci-burden/f48-swarm-mobile

Conversation

@steipete

@steipete steipete commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

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 1 throughout, parent done/inactive at revision 3, correct final-outcome text, and detailsSame:false / detailsOpen:false. The displayed job was 10/13; its actual invocation selected shard 10/12.

The earlier fixes in #153277 and #153168 explicitly left this race unresolved.

  • A deterministic regression through the real session capability fails on the original code with expected null to deeply equal initial, then passes with the fix. It also verifies admission of the fresh settled parent.
  • All 76 selected observer, Swarm-roster, component, and footer tests pass. The changed test file passes 17 cases in 12.70 seconds wall time; the new regression takes 15 ms locally. Hosted UI CI reports 0.099 seconds of test time for the file and 0.029 seconds for the new regression.
  • Linux Blacksmith Testbox lease 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 publishing applyParent(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.
  • Controlled mobile browser comparison reproduces the same final visibility assertion and replacement/closed diagnostic on original code (1/1 failed). With the fix, that exact ordering passes (0/1 failed), retaining the same open disclosure and keyboard focus. The unchanged lifecycle file passes 20/20 runs (140 cases). The exact logged 39-file shard passes three replays, each with 256 tests, in 293.93, 280.83, and 287.22 seconds. Runs use OPENCLAW_VITEST_MAX_WORKERS=8 with the E2E config’s existing two-worker policy; the original shard inventory is supplied through OPENCLAW_VITEST_INCLUDE_FILE.
  • node scripts/check-changed.mjs passes, including core/UI typechecks, type-aware lint, dead-export scans, and applicable guards. Formatting and git diff --check pass; a type-aware lint canary correctly rejects an unhandled promise.
  • Independent pre-commit and committed-branch reviews through P2: scoped-clean, no actionable findings. Hosted UI CI passes on this head: all three UI unit shards, all thirteen UI E2E shards, and the real-Gateway UI lane. The aggregate CI gate is blocked by the release-tooling timeout described below.

First hosted CI attempt: run 35545824271, head d98e924a674266c433f99478d13cd13daf177111, completed with 111 successful jobs, 13 skipped jobs, and two failures: checks-node-compact-small-46 and its aggregate openclaw/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.

Before: refresh closes the expanded Swarm results

After: the same Swarm disclosure stays open with its results

@clawsweeper

clawsweeper Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Sep 20, 2026
@steipete
steipete marked this pull request as ready for review September 20, 2026 23:50
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 20, 2026
@clawsweeper

clawsweeper Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed September 20, 2026, 8:37 PM ET / September 21, 2026, 00:37 UTC (Revision 3).

ClawSweeper review

What this changes

The 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
Reviewed head: b6eda032d2758564f3e6bc9db1160c1667fe5f7f

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused owner-level repair with a meaningful deterministic regression and directly relevant visual proof; the separate failure-diagnosis requirement remains a landing gate.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The supplied controlled mobile Chromium comparison exercises the changed row observer through the Swarm display; inspected before/after images show hidden versus visible results, and the accompanying account records preserved disclosure identity and focus after stale-response rejection.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The supplied controlled mobile Chromium comparison exercises the changed row observer through the Swarm display; inspected before/after images show hidden versus visible results, and the accompanying account records preserved disclosure identity and focus after stale-response rejection.
Evidence reviewed 8 items Pinned introduced change: The introduced production hunk retains held only for rejected non-null reads. Explicit null projections still clear the row; successor retirement and current-registration checks execute before this fallback.
Still necessary on main and latest release: Both fetched main and v2026.9.5 retain the null fallback. The previously merged Swarm work described in the supplied discussion explicitly leaves this visibility race unresolved.
Released behavior check: The latest supplied release also maps the rejected read to null; this review found no released replacement for the proposed fix.
Findings None None.
Security None None.

How this fits together

The 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
Loading

Before merge

  • Complete next step (P2) - Diagnose the earlier release-check timeout and cite its owning fix before landing; the subsequent passing shard does not establish that the failure was repaired.
Agent review details

Security

None.

PR surface

Source +2, Tests +60. Total +62 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 3 1 +2
Tests 1 62 2 +60
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 65 3 +62

Review metrics

Metric Value Why it matters
Regression test cost 15 ms local; 29 ms hosted test time The reported deterministic regression protects the refresh ordering without adding another browser scenario to per-PR CI.

Technical review

Best 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.

Labels

Label justifications:

  • P2: Unexpectedly collapsed completed Swarm results are a bounded UI behavior defect.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The supplied controlled mobile Chromium comparison exercises the changed row observer through the Swarm display; inspected before/after images show hidden versus visible results, and the accompanying account records preserved disclosure identity and focus after stale-response rejection.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied controlled mobile Chromium comparison exercises the changed row observer through the Swarm display; inspected before/after images show hidden versus visible results, and the accompanying account records preserved disclosure identity and focus after stale-response rejection.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The supplied controlled mobile Chromium comparison exercises the changed row observer through the Swarm display; inspected before/after images show hidden versus visible results, and the accompanying account records preserved disclosure identity and focus after stale-response rejection.

Evidence

What I checked:

  • Pinned introduced change: The introduced production hunk retains held only for rejected non-null reads. Explicit null projections still clear the row; successor retirement and current-registration checks execute before this fallback. (ui/src/lib/sessions/session-roster-observations.ts:336, b6eda032d275)
  • Still necessary on main and latest release: Both fetched main and v2026.9.5 retain the null fallback. The previously merged Swarm work described in the supplied discussion explicitly leaves this visibility race unresolved. (ui/src/lib/sessions/session-roster-observations.ts:336, 2969f4becc06)
  • Released behavior check: The latest supplied release also maps the rejected read to null; this review found no released replacement for the proposed fix. (ui/src/lib/sessions/session-roster-observations.ts:336, ec9c1a13db89)
  • Consumer and lifecycle boundary: The Swarm hydrator publishes empty rows when its parent becomes null; the renderer already keys disclosures by group identity. Row reconciliation separately handles explicit absence, deletion generations, connection retirement, and permission decoration. This is UI projection behavior with no affirmative Codex dependency signal. (ui/src/lib/sessions/swarm-roster.ts:188, b6eda032d275)
  • Meaningful regression coverage: The new test holds a list response across invalidation, settles it before the fresh descriptor, checks that no null is published, and then checks fresh terminal-state admission. It uses the existing session-capability fixture and fake timers without adding production test seams. The supplied body reports failure before the fix and success afterward; tests were not executed during this read-only review. (ui/src/lib/sessions/session-row-observation.test.ts:162, b6eda032d275)
  • Inspected visual proof: Inspected prepared proof-image-1.png and proof-image-2.png from the media manifest: before is collapsed; after displays the final outcome and child detail. The captured body, sourceRevision f0eb5de05cd22a1622da9a7cfe4bab97d88c3a5be52211a9eec361f6625ec814, connects these images to a controlled mobile Chromium stale-response comparison using the production observer and Swarm flow, reporting preserved disclosure identity and focus. The images directly support the visible result; the sequencing observations come from the supplied validation account. (d98e924a6742)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-20T23:58:02.665Z sha d98e924 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-21T00:26:11.764Z sha d98e924 :: needs changes before merge. :: none

@steipete
steipete merged commit 03b6338 into main Sep 21, 2026
150 checks passed
@steipete
steipete deleted the ci-burden/f48-swarm-mobile branch September 21, 2026 00:59
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant