Skip to content

fix(ui): archived sessions reappear after a failed refresh - #148155

Merged
steipete merged 4 commits into
mainfrom
codex/fix-batch-archive-confirmation
Sep 15, 2026
Merged

steipete merged 4 commits into
mainfrom
codex/fix-batch-archive-confirmation

Conversation

@steipete

@steipete steipete commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes archived sessions reappearing after a failed refresh, Undo leaving restored sessions hidden when change events are unavailable, and successful re-pins disappearing from Pinned. It also preserves held session descriptors when an accepted archive result arrives after read invalidation.

User Impact

Confirmed archive, restore, and pin results survive stale reads and failed refreshes. Late responses respect newer actions and cannot overwrite a replacement session at the same key. Refresh errors remain visible so users know when readback is unavailable.

Field confirmations do not reconstruct missing roster rows: if no loaded query retains a complete row and readback fails, a later successful refresh is still required to show it.

Why This Change Was Made

Batch actions now share the session capability and field reconciliation used by individual actions. The existing provenance owner retains captured session identity, action order, and which reads were already in flight when an acknowledgement arrived. Accepted results can update held descriptors while incoming reads retain their invalidation checks. Undo restores confirmed pin state without inventing a pin timestamp.

The integration preserves main's shared workspace-recovery flow and structured deletion errors. Offline workspace recovery still requires explicit consent before discarding changes and retrying archive or delete.

Evidence

The full 29-path archive candidate at 86f608f3, integrated with main 867e655d, passed:

  • 271 tests across 14 owner files.
  • 21 selected sidebar cases; 406 cases were excluded by the name filter.
  • Seven selected Chromium/mock-Gateway cases across three files; 13 cases were excluded by the name filter. These include archive/Undo and offline-workspace recovery for both archive and delete.
  • All 23 commands in the canonical changed-file gate, using the explicit main base and the full 29-path candidate.
  • Independent P0–P2 review across 15 context partitions, with zero findings.

All validation processes were joined, and source, index, and dependency bindings held. Proof uses isolated synthetic fixtures; it does not claim live-Gateway or full distribution-build validation.

CI then exposed a contradictory archived-actions fixture in the UI E2E shard: it broadcast an archive event while its mock server still returned an active session. The desktop and mobile cases failed; the cold-load control passed. The fixture now commits the archived row through the existing mock Gateway list setter before broadcasting, so the server response and event describe the same transition. Production code, original timestamps, and every assertion remain unchanged, including the requirement that branch switching, rewind, and publish become inert while Copy and Fork remain available.

The follow-up at 2a3b20cc10e50b012def5395d12328798b6dc499 passed the complete archived-actions file (3 cases), 2 selected archive/restore sibling cases (8 filtered), and all 18 commands selected by the scoped changed-file gate against 86f608f3. The unchanged original fixture reproduced both failing cases locally before the repair. A fresh independent P0–P2 review completed one proportional pass with zero findings. The updated UI E2E shard also passed on that exact head. The build job compiled successfully and passed its CLI smoke checks, but Gateway watch exceeded its unchanged readiness deadline and sampled startup CPU as idle CPU; the job was later cancelled after 20 minutes. One unchanged-head replay subsequently passed all required CI. Only the build job and aggregate gate reran; earlier successful UI jobs were reused. The replay used the workflow’s hosted Ubuntu route, so this is not a controlled startup-performance comparison. The original Blacksmith readiness failure remains recorded, and the measurement owner is being repaired separately without changing readiness or CPU thresholds.

The four historical screenshots below demonstrate session membership and refresh-error behavior. Their fixtures did not seed or assert pinned state, so these images do not establish pin restoration.

Before: archive succeeds but sessions reappear after refresh fails

After: archived sessions stay removed and the refresh error is visible

Before: Undo without change events leaves restored sessions hidden

After: Undo restores all three sessions

The pin-specific pair uses the retained historical causal-red before frame and a fresh after frame from the candidate integrated with 867e655d. Both show the Undo refresh error; the after frame also shows Batch A restored to Pinned. The added Systems navigation comes from newer main. This pair covers pin Undo with failed readback; descriptor ordering is covered by the owner tests, and the recovery cases provide behavioral assertions without dialog screenshots.

Before: successful Undo leaves Batch A outside Pinned when refresh fails

After: Batch A returns to Pinned while the refresh error remains visible

Visual verification on the signed-out PR confirms that all six embedded images render, including both pin-specific captures. The newer pair shows Batch A outside Pinned before the repair and restored to Pinned afterward, with the refresh error visible in both. The review worker’s image-retrieval cache miss does not reproduce on the published page.

Preserve successful archive and restore acknowledgements when change events
are missing or the following refresh fails. Route batch changes through the
session capability and reconcile their captured read and session identities.
Undo restores the prior pin while refresh errors remain visible.
@clawsweeper

clawsweeper Bot commented Sep 14, 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 docs Improvements or additions to documentation app: web-ui App: web-ui size: XL maintainer Maintainer-authored PR labels Sep 14, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 14, 2026
@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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 15, 2026, 12:31 AM ET / 04:31 UTC (Revision 7).

ClawSweeper review

What this changes

The Control UI preserves confirmed archive, restore, and pin changes across failed or stale refreshes, with matching regression coverage and documentation.

Merge readiness

✅ Ready for maintainer review

This remains a useful fix: current main still lacks the batch acknowledgement reconciliation. Both earlier pin-related findings are resolved, and this review found no remaining blocking defect.

Priority: P2
Reviewed head: 2a3b20cc10e50b012def5395d12328798b6dc499

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent owner-level repair with convincing visible proof, meaningful ordering coverage, and both earlier findings resolved.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected six before/after screenshots from the scoped Chromium/mock-Gateway flow showing archive, Undo, and pin recovery with visible refresh errors; the corresponding browser scenario exercises the changed session capability through sidebar actions.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected six before/after screenshots from the scoped Chromium/mock-Gateway flow showing archive, Undo, and pin recovery with visible refresh errors; the corresponding browser scenario exercises the changed session capability through sidebar actions.
Evidence reviewed 10 items Current main still needs the repair: At the fetched main revision, batch mutations still call the transport directly, while archive state lacks the new ordered restore receipts and field reconciliation.
Successful outcomes share the reconciliation owner: Batch confirmations capture agent and session identity, reconcile only successful outcomes, retain the read cutoff, and avoid publication after connection retirement. Pin acknowledgements preserve the confirmed boolean without inventing a server timestamp.
Earlier findings resolved: The earlier batch re-pin finding is addressed by pin-field confirmation in patchMany. Archive projection now includes pinned=false and clears pinnedAt, including when decorating late descriptors. Regression cases cover intervening reads, newer writers, replacement identities, and invalidated descriptors.
Findings None None.
Security None None.

How this fits together

The Control UI’s session capability reconciles Gateway responses and events into the session lists and held conversation details. Sidebar archive and Undo actions use those shared projections to display session membership and pin state.

flowchart TD
  A[Sidebar archive or Undo] --> B[Session capability]
  B --> C[Gateway mutation]
  C --> D[Confirmed field reconciliation]
  E[List reads and session events] --> D
  D --> F[Session lists and conversation details]
  E --> G[Visible refresh errors]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +275, Tests +822, Docs 0. Total +1097 across 30 files.

View PR surface stats
Area Files Added Removed Net
Source 14 554 279 +275
Tests 15 1130 308 +822
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 30 1685 588 +1097

Review metrics

Metric Value Why it matters
Production versus regression coverage Production +275 net lines; tests and test support +822 net lines Production growth implements shared field ordering and acknowledgement retention, with most net growth devoted to regression coverage.

Technical review

Best possible solution:

Keep confirmed mutation facts in the shared session reconciliation owner, while allowing newer authoritative reads to replace them and reporting readback failures separately.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: current-main batch acknowledgements bypass row reconciliation, so failed readback can leave old membership visible. The supplied browser proof demonstrates the scenario; this review did not execute it.

Is this the best way to solve the issue?

Yes. Routing batch acknowledgements through the existing session owner addresses the stale-state cause, preserves identity and newer-writer checks, and avoids a competing UI state store.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 52b49bb95dfa.

Labels

Label justifications:

  • P2: Repairs misleading session membership and pin state after failed refreshes, with a bounded Control UI impact.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected six before/after screenshots from the scoped Chromium/mock-Gateway flow showing archive, Undo, and pin recovery with visible refresh errors; the corresponding browser scenario exercises the changed session capability through sidebar actions.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected six before/after screenshots from the scoped Chromium/mock-Gateway flow showing archive, Undo, and pin recovery with visible refresh errors; the corresponding browser scenario exercises the changed session capability through sidebar actions.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected six before/after screenshots from the scoped Chromium/mock-Gateway flow showing archive, Undo, and pin recovery with visible refresh errors; the corresponding browser scenario exercises the changed session capability through sidebar actions.

Evidence

What I checked:

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 (6 earlier review cycles)
  • reviewed 2026-09-14T11:08:46.571Z sha ccc407f :: blocked before merge. :: none
  • reviewed 2026-09-14T11:51:39.026Z sha ccc407f :: blocked before merge. :: none
  • reviewed 2026-09-14T12:51:32.859Z sha ccc407f :: blocked before merge. :: [P2] Reconcile successful batch re-pins during Undo | [P2] Carry archive-implied pin clearing into late descriptors
  • reviewed 2026-09-15T01:48:32.292Z sha 86f608f :: needs maintainer review before merge. :: none
  • reviewed 2026-09-15T02:43:20.385Z sha 2a3b20c :: blocked before merge. :: none
  • reviewed 2026-09-15T03:41:44.126Z sha 2a3b20c :: needs maintainer review before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 14, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 14, 2026
Keep archive and pin acknowledgements through older reads, failed refreshes, and late descriptor registration. Use the existing session capability for batch changes, preserve session identity and newer-writer precedence, and restore confirmed pins during Undo.

The main integration passed 271 owner tests, 21 selected sidebar cases, seven mocked browser flows, the 23-command local changed gate, and a fresh independent P2 review. Exact-head CI follows publication.
@steipete steipete self-assigned this Sep 15, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 15, 2026
Update the canonical mock session rows before broadcasting the archive event so later reads agree with the tested transition. Preserve the existing timestamps and inert-action assertions.
@steipete
steipete merged commit 3dbc8e2 into main Sep 15, 2026
247 of 249 checks passed
@steipete
steipete deleted the codex/fix-batch-archive-confirmation branch September 15, 2026 04:46
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 16, 2026
…148155)

* fix(ui): keep archive results consistent across stale reads

Preserve successful archive and restore acknowledgements when change events
are missing or the following refresh fails. Route batch changes through the
session capability and reconcile their captured read and session identities.
Undo restores the prior pin while refresh errors remain visible.

* test: commit archived state before action checks

Update the canonical mock session rows before broadcasting the archive event so later reads agree with the tested transition. Preserve the existing timestamps and inert-action assertions.
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 docs Improvements or additions to documentation 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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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