Repository navigation
fix(ui): hidden retained chat panes silently clear unread/attention for background sessions - #123247
Conversation
…s you are not viewing Since retained panes (#121625) every pane — hidden or presented — keeps its sessions subscription alive, and applySessionsState marked the pane's selected session read unconditionally. New activity in a recently-viewed session was cleared by its hidden pane instantly: the sidebar unread dot never stuck, agentStatus attention was wiped by the read patch, and "Mark as unread" self-reverted. Gate the read-marking on this.presented, matching applyActiveSessionBindings.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 13, 2026, 10:21 PM ET / August 14, 2026, 02:21 UTC. ClawSweeper reviewWhat this changesThe PR prevents hidden retained Control UI chat panes from clearing unread and attention state for sessions the user is not viewing. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open for maintainer review: the patch targets a P1 session-state regression, but this review environment could not perform any read-only checkout inspection because its sandbox fails before commands execute. Likely related people: steipete (high-confidence retained-pane and read-marker history). Priority: P1 Review scores
Verification
How this fits togetherThe Control UI retains recent chat panes for quick switching while each pane receives live session updates. A visible pane may patch its selected session as read; that state drives sidebar unread and attention indicators. flowchart LR
A[Gateway session updates] --> B[Retained chat panes]
B --> C[Pane presentation state]
C --> D[Read-marker decision]
D --> E[Session state patch]
E --> F[Unread and attention indicators]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +5, Tests +40. Total +45 across 3 files. View PR surface stats
Review metrics
Mantis proof suggestionA short web UI chat proof would directly demonstrate the background unread-indicator behavior affected by this lifecycle change. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve the presentation-owned read gate if exact-head lifecycle inspection confirms that foreground activation and visible-pane bindings still clear unread state through a canonical path. Do we have a high-confidence way to reproduce the issue? No high-confidence independent reproduction is available in this review because the checkout sandbox rejected read-only commands before source or tests could be inspected; the provided diff contains a focused unit scenario. Is this the best way to solve the issue? Unclear: gating the read marker on presentation matches the stated invariant, but the exact foreground lifecycle and sibling paths could not be checked in the unavailable checkout. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against 0d584aabfba7. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
|
Merged via squash.
|
…s you are not viewing (openclaw#123247) Since retained panes (openclaw#121625) every pane — hidden or presented — keeps its sessions subscription alive, and applySessionsState marked the pane's selected session read unconditionally. New activity in a recently-viewed session was cleared by its hidden pane instantly: the sidebar unread dot never stuck, agentStatus attention was wiped by the read patch, and "Mark as unread" self-reverted. Gate the read-marking on this.presented, matching applyActiveSessionBindings.
What Problem This Solves
New activity in a recently viewed session never shows an unread badge. Since retained panes shipped (#121625), the chat page keeps up to 3 hidden session panes in the DOM (
presented=false,inert). Every pane — hidden or not — keeps its sessions subscription alive, andapplySessionsStatemarked the pane's selected session read unconditionally. So when a session you looked at earlier gets new activity (or an agentStatus attention note), its hidden pane instantly patchesunread:false— the sidebar dot never sticks, the gateway read-patch also deletesagentStatus, and "Mark as unread" from the session menu self-reverts immediately.Why This Change Was Made
Root cause is the missing presentation gate at the read-marking site. The sibling path
applyActiveSessionBindingsalready gates onthis.active && this.presented;applySessionsState'smarkSessionReadcall predates retained panes and was never updated when hidden panes started keeping live subscriptions. One condition at the owner restores the invariant: only the pane the user is actually looking at may clear unread/attention state.User Impact
Unread badges and attention indicators stick for background sessions until you actually open them. "Mark as unread" works on recently viewed sessions.
Evidence
applySessionsStatewithpresented=false(no patch) thenpresented=true(patch fires) — fails pre-fix, passes post-fix.tsconfig.test.ui.jsonclean.Found by the session list/roster lane of the web-UI QA campaign (severity-highest finding; default-path silent regression of the unread feature).