fix(ui): clear stale sidebar run state after chat final#101293
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 7, 2026, 1:32 AM ET / 05:32 UTC. Summary PR surface: Source +91, Tests +244. Total +335 across 6 files. Reproducibility: yes. source-reproducible: current main lets the chat pane clear local run state while the sidebar continues to render shared SessionCapability active-run state. I did not run a live browser repro in this read-only review. Review metrics: none identified. Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Land the shared SessionCapability terminal reconciliation with the run-id ownership guards and exact-head merge checks, keeping the sidebar and chat pane driven by the same terminal event. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main lets the chat pane clear local run state while the sidebar continues to render shared SessionCapability active-run state. I did not run a live browser repro in this read-only review. Is this the best way to solve the issue? Yes: publishing terminal state through SessionCapability is the right boundary because sidebar subscribers read that cache. A local-only chat-pane fix misses the sidebar, while clearing active rows without run-id ownership would risk hiding genuine recovered runs. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5d7a451b1532. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +91, Tests +244. Total +335 across 6 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
Review history (1 earlier review cycle)
|
|
Updated the branch at Proof:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@openclaw-mantis web ui chat proof: verify that after a completed chat turn the active sidebar session spinner clears and does not reappear after a stale sessions.changed update. |
|
Land-ready review complete.
|
|
Merged via squash.
Thanks @fuller-stack-dev! |
) Merged via squash. Prepared head SHA: 32a33eb Co-authored-by: fuller-stack-dev <[email protected]> Reviewed-by: @fuller-stack-dev
) Merged via squash. Prepared head SHA: 32a33eb Co-authored-by: fuller-stack-dev <[email protected]> Reviewed-by: @fuller-stack-dev
) Merged via squash. Prepared head SHA: 32a33eb Co-authored-by: fuller-stack-dev <[email protected]> Reviewed-by: @fuller-stack-dev
Summary
sessions.changedraceRoot cause
The composer lifecycle fix cleared the chat pane's local session projection, but the sidebar reads the shared
SessionCapabilitycache. When a final chat event arrived before the terminal session publication, the composer could become idle while the shared sidebar row remained active. A duplicate stale session publication could also revive the completed run after the local terminal projection.This change publishes the owned terminal run through both projections and keeps its identity as a tombstone until the Gateway reports terminal state or a different run. Active rows are only cleared when their advertised run ID matches the terminal event.
Testing
pnpm tsgo:test:uinode scripts/run-oxlint.mjs ui/src/e2e/chat-run-lifecycle.e2e.test.ts ui/src/lib/sessions/index.test.ts ui/src/lib/sessions/index.ts ui/src/pages/chat/run-lifecycle.test.ts ui/src/pages/chat/run-lifecycle.tspnpm test ui/src/lib/sessions/index.test.ts ui/src/pages/chat/run-lifecycle.test.ts ui/src/e2e/chat-run-lifecycle.e2e.test.ts -- --reporter=verbose