Repository navigation
fix(webchat): keep waiting replies visible after yielding - #162272
roboclaw-bot wants to merge 2 commits into
Conversation
Persist public continuation replies through the shared source finalizer, retain live admission and transcript guards, and leave one owner for media-bearing acknowledgments. Cover direct and queued WebSocket publication, history reloads, privacy, and duplicate delivery. Co-authored-by: jalehman <[email protected]>
Enforce live ownership at the expected transcript commit, keep waiting acknowledgments separate from neighboring notices, and join continuation settlement to host persistence and publication. Preserve model and queued execution outcomes while reporting host delivery failures. Co-authored-by: jalehman <[email protected]>
|
🦞👀 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 30, 2026, 10:00 PM ET / October 1, 2026, 02:00 UTC. ClawSweeper reviewWhat this changesThe branch saves public WebChat waiting replies as assistant transcript messages before live delivery and reports late storage failures. Merge readiness✅ Ready for maintainer review Keep open: current main still lacks durable persistence for new public waiting replies. The older draft replay PR addresses historical records and does not replace this repair. Priority: P2 Review scores
Verification
How this fits togetherWebChat sends turns to the Gateway, which dispatches agent replies and stores conversation history. The Gateway sends live chat events and serves saved messages to the UI after refresh. flowchart LR
A[WebChat turn] --> B[Gateway reply dispatch]
B --> C{Waiting reply?}
C -->|Yes| D[Guarded transcript write]
D --> E[Live chat event]
D --> F[Saved chat history]
E --> G[WebChat display]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +181, Tests +611. Total +792 across 9 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep public acknowledgments in the existing guarded transcript path and leave privacy-sensitive historical replay to its separate review. Do we have a high-confidence way to reproduce the issue? Yes. A yielding, otherwise silent WebChat turn can send a waiting reply live and then reload history; current main's finalizer does not append that reply. This review did not execute a current-main run. Is this the best way to solve the issue? Yes. The branch uses the existing assistant-transcript owner and checks live authority before commit, without projecting private yield context or adding a parallel store. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 28db8ffbd545. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Related: #87321
What Problem This Solves
Fixes: a waiting acknowledgment can be missing from WebChat, or disappear after refresh, when an otherwise-silent agent yields for ongoing work.
User Impact
User impact: explicit acknowledgments and the default waiting reply appear once and remain in history for direct and queued WebChat turns. A storage failure is reported instead of silently treating the acknowledgment as delivered. No configuration, schema, or migration change is required.
Why This Change Was Made
WebChat now persists the public continuation payload through the existing assistant-transcript owner before publishing it or settling continuation delivery. The transcript transaction consumes the original live authority check after awaited preparation. Canonical acknowledgment messages stay separate from neighboring notices, so live events and history reconcile to one row. Native model completion remains distinct from a later host-delivery failure.
This does not read private yield context, promote tool-result text, or change quiet-turn/visible-reply suppression and child-wake policy. #87471 is an older replay attempt; historical tool-result migration is not part of this repair.
Contributor credit: @jalehman identified the affected workflow and drove this repair.
Work sessions
Evidence
3d038b6405e211fea4e83f3e5615c66bf0ea8f44also found no actionable P0–P2 issues and verified all three earlier findings resolved.Measured test cost
Serial runs use
node scripts/run-vitest.mjs <file> --maxWorkers=1:server.chat-queued-followup.test.ts: 19 cases, 57.34 s wall including compilation; the 13 added cases take 12.76 s combined. One suite-level Gateway is reused.transcript-write-context.test.ts: 26 cases, 23.55 s wall including compilation; the seven added cases take 1.20 s combined.chat-gateway.late-delivery-error.test.ts: two cases take 18 ms combined; its isolated UI shard takes 2.26 s.Before and after
Before — the public waiting acknowledgment is absent from replay.
After — one public waiting acknowledgment remains visible.
Boundary proof uses controlled upstream execution; Gateway dispatch, WebSocket delivery, SQLite persistence, history RPCs, and client projection are real. The inspected screenshots use the actual unchanged Control UI with a sanitized synthetic history replay of those proven Gateway outcomes. They show rendering/reload behavior, not a fresh live-provider conversation.
Scope and line-count accounting
Production: +247/−66 (net +181); tests: +612/−1 (net +611). Growth supplies missing durable host-reply publication and settlement, consumes the existing live-owner assertion at the transaction boundary, and preserves canonical message identity across mixed notices. It reuses existing transcript storage and removes the competing media-write path; there is no new store, schema, protocol, dependency, or configuration surface.