Repository navigation
fix(ui): archived sessions reappear after a failed refresh - #148155
Conversation
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.
|
🦞👀 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. Reviewed September 15, 2026, 12:31 AM ET / 04:31 UTC (Revision 7). ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherThe 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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +275, Tests +822, Docs 0. Total +1097 across 30 files. View PR surface stats
Review metrics
Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
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.
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.
|
Merged via squash.
|
…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.
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 main867e655d, passed: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
2a3b20cc10e50b012def5395d12328798b6dc499passed 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 against86f608f3. 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.
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.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.