Repository navigation
fix: keep retained inputs in transcript order - #134261
Conversation
Worked on by: - @VACInc Co-authored-by: Vito Cappello <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 3:33 PM ET / 19:33 UTC. ClawSweeper reviewWhat this changesThe PR timestamps retained pending inputs at Gateway acceptance and inserts them into the Control UI transcript according to that time. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open: current main still lacks the acceptance-time projection and chronological insertion, while this PR supplies a focused repair with no blocking correctness finding. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway returns retained interrupted or cancelled inputs alongside session history. The Control UI combines those rows with canonical history so the transcript shows an input where it was accepted. flowchart LR
A[Accepted chat input] --> B[Pending input record]
B --> C[Gateway history response]
C --> D[Transcript insertion]
D --> E[Chronological chat display]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -4, Tests +82. Total +78 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the focused repair after normal exact-head merge gates, retaining the Gateway-owned acceptance timestamp and the UI’s existing stable timestamp insertion path. Do we have a high-confidence way to reproduce the issue? Yes—source inspection shows the base branch appended pending rows after timestamp-aware projections, while the changed tests encode the resulting ordering failure; the PR also supplies an exact-head browser scenario. Is this the best way to solve the issue? Yes—the Gateway owns the authoritative acceptance fact and the UI reuses its existing stable insertion routine, avoiding a second ordering mechanism or downstream workaround. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0820b89d3b20. 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)
|
|
Land-ready evidence refresh for exact head
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
Worked on by: - @VACInc Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: Vito Cappello <[email protected]>
What Problem This Solves
Fixes an issue where retained accepted chat inputs appeared at the bottom of the transcript instead of where they were accepted. Interrupted or cancelled inputs could therefore look pinned below much newer replies and disconnected from the conversation that produced them.
Why This Change Was Made
The Gateway now projects each retained input with its authoritative acceptance timestamp. The Control UI feeds those rows through the transcript's existing timestamp-aware insertion path instead of appending them after every canonical message. Stable transcript rows keep their existing relative-order and clock-skew protections.
User Impact
Retained queued, interrupted, and cancelled inputs now flow chronologically with the surrounding chat. Their state notice remains visible, but the input no longer appears glued to the latest-message boundary.
Evidence
Real isolated Gateway + Control UI before/after proof: both recordings exercise a production Gateway over WebSocket into real Chromium at 1280×720, with isolated state and providers disabled. The parent and exact PR head use the same retained interrupted-input scenario.
Broken parent
00d542d3dc1f88dc18526e11eee5641782dae9e7:Timeline 02renders afterTimeline 05; the Gateway trace records acceptance at1788201340281while the projected message still carries the stale1788201279736timestamp.real-gateway-broken.webm
Fixed exact head
c960a56f59747c70fe23d29702a207bfbc58c5da:Timeline 02renders betweenTimeline 01andTimeline 03; the projected message timestamp is the authoritativeacceptedAtvalue (1788202352545), and the interrupted-state notice remains visible.real-gateway-fixed.webm
Deterministic Chromium fixture proof remains as a second oracle:
Before the fix, the new chronology regression failed because the later replies were grouped first and the older retained input was appended last.
node scripts/run-vitest.mjs ui/src/pages/chat/chat-pending-inputs.test.ts— 31 passed.node scripts/run-vitest.mjs src/gateway/server-methods/chat-history-handler.test.ts— 9 passed.node scripts/check-changed.mjs -- src/gateway/server-methods/chat-history-handler.test.ts src/gateway/server-methods/chat-pending-inputs.ts ui/src/pages/chat/chat-pending-inputs.test.ts ui/src/pages/chat/chat-thread-build.ts— passed.Exact-head Codex autoreview — scoped-clean, 0.99 confidence, no accepted/actionable findings.
Production LOC: +8/-12 (net -4). Tests: +82/-0.
Provenance: the unconditional pending-input append was introduced in
6c9954cbb69880960257eb7811581b0b5dedc774(#132887). Raw-parent comparison against64f4a18ddd513b65d85bfc705a0b45d94f5fe467confirms that commit added the append after all timestamp-aware transcript insertion.Worked on by