Repository navigation
fix: reset chat baselines when an observer unsubscribes - #169693
Conversation
Invalidate text receipts after acknowledged unsubscribe while preserving queued narration for remaining observers.
|
🦞👀 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. What this changesThis PR resets text delivery baselines when an observer unsubscribes while preserving narration queued for remaining observers. Example: Observers first and second share agent:main:chat; first unsubscribes after receiving A, then the answer becomes AB.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it fixes a concrete current-main disconnect through the existing subscription owner, preserves queued narration, and introduces no actionable correctness finding. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Gateway subscriber registry aggregates observer interests per connection and session, notifying text receipt and narration owners before the broadcaster delivers events to clients. flowchart LR
A[Browser observers] --> B[Subscription RPC]
B --> C[Subscriber registry]
C --> D[Text receipts]
C --> E[Narration queue]
D --> F[Gateway broadcaster]
E --> F
F --> G[Browser text projection]
Technical reviewBest possible solution: Land the focused registry notification repair with narration preservation and the boundary regressions. Do we have a high-confidence way to reproduce the issue? Current-main registry notifications, receipt invalidation, and browser baseline retirement establish the failure path; the PR reports a matching failing-before regression, but this read-only review executed no code. Is this the best way to solve the issue? The repair corrects stale receipts at their producer and distinguishes baseline retirement from subscription-intent changes without adding another state owner or public option. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 37143d77e2c3. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +6, Tests +101, Docs +2. Total +109 across 5 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 12, 2026, 3:07 AM ET / 07:07 UTC (Revision 2). |
|
Merged via squash.
|
What Problem This Solves
Fixes: a shared chat stream disconnects when one of several full observers on the same connection unsubscribes and another update arrives.
User Impact
Remaining observers continue receiving chat text and queued narration after another observer releases its subscription. Releasing the final observer still stops delivery, and later subscriptions receive a complete snapshot.
Why This Change Was Made
The browser retires its text baseline after an acknowledged unsubscribe. The Gateway previously invalidated its matching broadcast receipt only when aggregate interest changed, leaving it to send append-only text to a client without a baseline. The existing registry now records an explicit baseline-only reset when other observers preserve aggregate interest. Its existing live-text listener invalidates receipts; narration preserves queued snapshots because its aggregate intent has not changed. This distinction addresses a concrete sibling regression without another state owner or a public protocol/config change. Production code grows by six lines after folding the narration guard and reusing the existing listener contract.
Evidence
3dc05f57daff741d0020e4bea2aeb2cb651ff91cpassed with no actionable findings (106.192 s command wall). The earlier finding, pre-fold clean review, and final review are preserved in durable task evidence.core-test-gateway-server, which contains both broadcaster tests and the UI imports. Production core types passed (59.250 s), followed serially by that consumer graph (48.974 s). Each launch met the coordinated memory/compiler limits; a prior capacity hold launched no compiler and is retained. Earlier graph listing exited 137 without a TypeScript diagnostic, so it is not classified as a code error or proven OOM. No all-graph compiler sweep was run; these are scoped local checks, not a completecheck:changed, remote CI, or live-browser claim.