Repository navigation
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. What this changesThe branch keeps streamed replies visible until their saved history rows publish and delays terminal chat delivery until pending publication attempts settle. Example: A reader types while a collaborator's reply becomes saved history.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review This PR remains useful: current main still has the publication gap, and the narrowed repair has convincing browser evidence with no actionable findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway turns agent output and saved conversation rows into updates for chat clients. Its live reply buffer bridges streaming output to published history so readers see a continuous conversation. flowchart TD
A[Agent streams reply] --> B[Gateway reply buffer]
C[Transcript commits row] --> B
C --> D[History publication attempt]
B --> E[Visible streaming reply]
D --> F{Saved row published?}
F -->|Yes| G[Retire matching live text]
F -->|No| E
G --> B
D --> H[Settle prepared terminal frame]
Technical reviewBest possible solution: Keep the handoff in the existing Gateway reply buffer, preserving complete replies, fallback visibility, and successor-run isolation. Do we have a high-confidence way to reproduce the issue? Yes: current source exposes premature live-text retirement, and the supplied real-Gateway/browser scenario records baseline scroll displacement. This review did not independently run the scenario. Is this the best way to solve the issue? Yes: correcting the Gateway publication handoff addresses the transient conversation collapse at its producer while retaining existing deduplication and client scroll behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 409cef15bea2. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +231, Tests +228. Total +459 across 10 files. Added test files: 0. View PR surface stats
LabelsLabel 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 8, 2026, 5:40 PM ET / 21:40 UTC (Revision 2). |
Keep committed assistant text visible until its saved row publishes. Hold only the terminal chat frame in the existing run buffer; backend cleanup, error grace, retry admission and notification queues keep their existing owners. Cancel stale handoffs when an execution is replaced. Fixes the handoff regression introduced by af210e1 (#167054). The unchanged real-Gateway test retains both reading anchors at 0 px. Dedup, lifecycle ownership, fixture, type, lint and P2 proof pass.
8f18b42 to
b73851c
Compare
|
Closing after verifying the remaining repair is merged on main. The primary delayed-publication scrollback fix was already covered by commit 1f9022d. The remaining failure cases—retaining visible replies when transcript publication fails, carrying handled reader failures through terminal delivery, and avoiding duplication when a repeated receipt later succeeds—are now fixed by #174087, merged as 3d52679. The replacement uses the current occurrence/publication owner rather than applying this older buffering implementation wholesale. Exact-head CI passed, the landed composition was verified against the reviewed source, and @steipete credit is preserved in the PR and squash commit. |
What Problem This Solves
Fixes shared chats jumping out of scrollback when a collaborator's reply moves from streaming output into saved history.
User Impact
Readers keep their place through queued input, streaming, and persistence. Following the conversation tail and resuming it with a local message continue to work.
Why This Change Was Made
The regression in #167054 retired committed assistant text before asynchronous transcript publication supplied its saved row. The reply briefly collapsed and the browser clamped scrollTop.
The existing run-buffer owner now distinguishes committed history ownership from published live-text ownership. It retains the live occurrence until publication and holds only the prepared terminal chat frame while publication attempts settle. Failed reads retain available fallback text. Resets and successor executions discard the predecessor's waiting frame.
Backend cleanup does not wait for transcript publication. Error-grace timers, retry admission and the existing transcript notification queue keep their baseline behavior. No protocol fields or persisted formats change.
This replaces the initial 17-file draft (+1008/-345) with 10 existing files (+661/-202), with no new modules. Production net growth is +231 lines versus +202 in the initial draft: the reduction is in responsibilities and total scope, not production LOC. The separate grace/publication modules, admission changes, asynchronous lifecycle finalizer, extra notification queue and protocol documentation changes are gone.
Evidence
The original real-Gateway E2E file and every-frame <=1 px anchor/scrollTop assertions are unchanged. Authentication, WebSockets, persistence and rendering are real; inference and conversation data use the credential-free synthetic fixture.
Final exact-source proof: the headless real-Gateway test passes in 81.76 seconds with reading top=584 and reading-typed top=4882, both retaining anchor=35. All 205 selected Gateway tests and both database-backed fixtures (37 tests) pass. The 179 unchanged UI dedup tests also pass.
A full check-changed run passes, including core types and all 27 test type graphs. The last two-file ingress delta separately passes the browser replay, affected tests, core and all selected test type graphs, typed/boundary lint, formatting and line-count gates. Full source-contracts, architecture (zero cycles), and deadcode:full pass; their unchanged graph proof is retained. All ten final file hashes match the reviewed and tested sources.
The final browser replay uses the ordinary repo UI E2E configuration: the prebuilt-only configuration correctly refused the intentionally dirty two-file overlay before running any test.
Codex P2 review is scoped-clean. Each accepted ownership finding has a failing-before/passing-after regression. The commentary file passes 23 cases locally in 24.51 seconds, predominantly worker compilation; the added cases take a few milliseconds and use no real waits.
The simpler publication-before-retirement attempt failed five existing dedup cases. Holding retirement alone lost the remaining live text when an earlier saved row arrived after final delivery. The retained mechanisms correspond to these failures:
The prior broader Gateway-server run passed 502 files / 5,069 tests and failed six sessions-send cases. The unchanged baseline reproduced those same failures. That attribution and the original shard proof are reused; they are not represented as fresh full-suite passes for this rewrite.
The rendered result is unchanged from the inspected synthetic evidence below, so the original screenshots are retained.