Repository navigation
fix(ui): refresh managed sessions on terminal events - #125040
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 12:39 AM ET / 04:39 UTC. ClawSweeper reviewWhat this changesThe PR makes terminal Gateway session events refresh matching managed Sessions-page query snapshots. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessNo code-level blocking finding: the patch restores managed Sessions-list refresh at the shared roster owner after terminal events. Keep it open for exact-head CI completion and live UI proof. Priority: P1 Review scores
Verification
How this fits togetherThe Control UI receives Gateway session events, refreshes its canonical roster, and serves scoped managed snapshots to the Sessions page. A terminal event must update both paths so a completed run no longer remains displayed as active. flowchart LR
A[Gateway terminal event] --> B[Session event gate]
B --> C[Canonical roster refresh]
B --> D[Matching managed lists]
C --> E[Session state]
D --> F[Sessions page]
E --> F
Before merge
Agent review detailsSecurityNone. PR surfaceSource -4, Tests +82. Total +78 across 3 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the shared roster scheduler as the single refresh owner, attach a sanitized real Sessions-page terminal-state transition, and merge only after the exact head is green. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main passes a terminal session.message through canonical refresh but marks it unfiltered, preventing managed Sessions queries from scheduling. Tests were not run because this is a read-only review. Is this the best way to solve the issue? Yes. Updating the shared roster scheduler is the best fix because the Sessions page consumes managed snapshots; a page-local reload would recreate the duplicate refresh ownership removed by the preceding refactor. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d095113698b6. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
125aaa6 to
d9ba79c
Compare
|
Land-ready proof for exact head The terminal-event acceptance criterion from #125018 is now satisfied: after the existing non-terminal Proof:
ClawSweeper review resolution: #125040 (comment) reports no code-level or security finding and calls the shared roster owner the best fix. It has no explicit |
|
Merged via squash.
|
Fixes follow-up from #125018
What Problem This Solves
Fixes an issue where users viewing Sessions could continue to see a run as active after it had finished when the Gateway delivered a terminal
session.messagewithout a latersessions.changedevent.Why This Change Was Made
Terminal session messages already pass the authoritative event gate and refresh the canonical roster. This change removes the obsolete event-type switch that stopped there, so the same event also invalidates matching managed session-list queries while preserving agent scoping and the early return for non-terminal messages. It does not restore page-local loading or canonical-revision reloads.
User Impact
The Sessions page now adopts terminal status and server ordering promptly after a run finishes. There is no visual styling delta; this is a terminal-state freshness correction.
AI-assisted: yes.
Evidence
donewhile the Sessions-style managed snapshot remainedrunning.OPENCLAW_HEAVY_CHECK_LOCK_SCOPE=worktree node scripts/run-vitest.mjs ui/src/lib/sessions/index.test.ts ui/src/lib/sessions/index-list.test.ts ui/src/lib/sessions/index.event-refresh.test.ts ui/src/pages/sessions/sessions-page.roster.test.ts— 62/62 passed.OPENCLAW_HEAVY_CHECK_LOCK_SCOPE=worktree node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/session-list-filter.e2e.test.ts— 4/4 passed.git diff --checkpassed.run_88bf32570a1aon leasecbx_782424ed3adbpassed with exit 0 after Blacksmith was unavailable: https://crabbox.openclaw.ai/portal/runs/run_88bf32570a1a