Repository navigation
fix(ui): recover viewer presence after a lost acknowledgment - #156255
Conversation
|
🦞👀 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 23, 2026, 3:28 AM ET / 07:28 UTC (Revision 2). ClawSweeper reviewWhat this changesAdds a deadline and cancellation to Control UI viewer-presence declarations so lost acknowledgments can retry without reconnecting the chat socket. Merge readiness✅ Ready for maintainer review The fix remains useful, and the previous caller-test finding is resolved. No blocking correctness or security findings remain in the reviewed patch. Priority: P2 Review scores
Verification
How this fits togetherChat panes declare which sessions the user is viewing through a shared Control UI presence store. The store sends the current session set to the Gateway and clears it when the last pane closes. flowchart LR
A[Visible chat panes] --> B[Shared presence store]
B --> C[Bounded Gateway request]
C --> D[Gateway viewer set]
C --> E{Acknowledgment received}
E -->|Yes| F[Confirm current declaration]
E -->|Deadline expires| G[Existing retry scheduler]
G --> B
F -->|Final empty set| H[Detach listeners]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +13, Tests +218. Total +231 across 4 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep declaration recovery in the existing presence owner, using bounded requests while preserving coalescing, stale-result rejection, and acknowledged final clearing. Do we have a high-confidence way to reproduce the issue? Yes, from source: withholding a viewer declaration acknowledgment while healthy ticks continue leaves main's request pending indefinitely. The focused browser regression models this trigger, but this review did not execute it. Is this the best way to solve the issue? Yes. Applying the existing deadline and cancellation contract at the declaration owner is narrower than changing global deadlines or reconnecting a healthy socket. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3ab93b4ea598. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…w#156255) * fix(ui): recover stalled viewer presence acknowledgments * test(ui): verify bounded viewer declarations at chat caller
What Problem This Solves
Fixes: viewer presence can remain stuck when a declaration acknowledgment is lost even though the chat connection is healthy.
User Impact
Viewer declarations recover without reconnecting a healthy chat socket. Closing the last pane still clears its presence before the declaration listeners detach.
Why This Change Was Made
Use the existing 30-second request deadline and retry owner for this idempotent declaration. Superseded declarations release their local pending request, while unchanged declarations remain coalesced and late replies cannot confirm newer state.
Production LOC: +17/-4 (net +13) | Tests: +266/-48 (net +218). The added owner state retires superseded local waiters through the existing pending-request contract. This changes one production owner. It does not change global request deadlines, reconnect policy, pull-request subscriptions, or the server protocol.
Evidence
The browser proof uses the real Control UI and a synthetic Gateway that withholds the acknowledgment while continuing normal ticks. It is not deployed or external-Gateway verification. No rendered appearance changes.