Repository navigation
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 14, 2026, 12:59 PM ET / 16:59 UTC. Summary PR surface: Source +34, Tests +149. Total +183 across 3 files. Reproducibility: yes. Current main has a high-confidence source reproduction path: the gateway returns bounded Review metrics: none identified. Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the focused Control UI adoption fix after maintainer review, and track active tool-call snapshot replay separately if it remains a required reconnect behavior. Do we have a high-confidence way to reproduce the issue? Yes. Current main has a high-confidence source reproduction path: the gateway returns bounded Is this the best way to solve the issue? Yes. The PR uses the existing gateway/TUI AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7e12a3326dd2. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +34, Tests +149. Total +183 across 3 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@vincentkoc when you have a window — this is the Control UI parity fix for the in-flight streaming reply being lost on reconnect (#90755), the narrow solution ClawSweeper called the best fit. Diamond-rated with sufficient proof (real headless-Chrome e2e + a negative control), CI green, mergeable clean; it covers the Control-UI side that the HTTP-only #90832 does not. A few of my other small fixes are sitting green-and-ready as well if you are doing a sweep — all narrow, all with sufficient proof and clean/mergeable: #89260 (doctor platform-skill rollup, reviewer concern just closed out), #88988 (status footer), #87487 (mcp list scope). Happy to rebase or trim any of them on request. |
|
Hi @vincentkoc — I see you're sweeping the TUI/UI surface today (just merged the tui spinner fix #92909). This Control UI reconnect fix is right in that area and ready to slot into the sweep: diamond-rated, sufficient proof (real headless-Chrome e2e + a negative control), CLEAN/mergeable. It is the narrow Control-UI-parity solution ClawSweeper flagged as the best fit for #90755, covering the Control-UI side that the HTTP-only #90832 does not touch. Happy to rebase on request. |
vincentkoc
left a comment
There was a problem hiding this comment.
Deep review found that the reconnect adoption path needs a canonical stream reconciliation step before this is safe to merge:
inFlightRun.textis the accumulated gateway buffer and can overlap assistant text already returned in history, so assigning it wholesale can duplicate persisted prefixes/final text.- Re-adopting a run must clear stale terminal run status.
- Refreshing an already-owned empty-text run must preserve its reading indicator instead of appearing idle.
Best fix: reconcile the in-flight snapshot against returned history and surviving local stream state in one helper, rendering only an unpersisted tail while clearing stale terminal state and preserving supported empty active streams. Local guards for each symptom will keep producing edge cases.
|
Closing this implementation after maintainer deep review. The reported reconnect bug in #90755 is valid, but this patch is not safe to land as written: The correct fix needs a canonical gateway/history contract that identifies or carries the unpersisted portion of the active run, then lets both Control UI and TUI adopt it without text inference. #90755 remains open for that owner-boundary fix. Thanks for the strong focused proof and for surfacing the missing Control UI behavior. |
Summary
chat.history/chat.startupinFlightRunpayload (built fromchatAbortControllers/chatRunBuffersand bounded byboundInFlightRunSnapshotForChatHistory), and the TUI history loader already consumes it (src/tui/tui-session-actions.ts). The Control UI history loader did not.inFlightRuncontract: the loader re-adopts the in-flight run id, rehydrates the buffered partial intochatStream, and setschatStreamStartedAt, so the partial renders again and subsequent live deltas/final continue on the adopted run. It is symmetric with the TUI fix and adds no new reconnect subsystem or wire-protocol change.resetStream && !state.chatRunId), so a fresher live local stream is never clobbered by a slightly stale history snapshot. Empty buffered text (e.g. Codex-style runtimes that only deliver assistant text at completion, or text dropped by the history budget) still adopts the run so the thread showsstreaming(reading indicator) instead of looking idle.This is the Control UI parity fix ClawSweeper called out as the best narrow solution on the issue, and the path the HTTP-only PR #90832 did not cover.
Linked context
Closes #90755
Real behavior proof
chat.history/chat.startupinFlightRunpayload was never adopted by the browser history loader, so on switch-back/reload the thread showed only committed history.ui/src/ui/e2e/chat-flow.e2e.test.tsagainst the mock gateway; system Chrome 138 used viaPLAYWRIGHT_CHROMIUM_EXECUTABLE_PATHsince the Playwright CDN is blocked on this host).PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/bin/google-chrome node node_modules/.bin/vitest run --config test/vitest/vitest.ui-e2e.config.ts ui/src/ui/e2e/chat-flow.e2e.test.ts -t "in-flight streaming assistant reply on reconnect"/chat; the gateway returns committed history = only the user turn, plusinFlightRun: { runId, text: "Streaming the summary so" }. The test asserts the partial assistant text becomes visible in the real.chat-threadDOM, then emits a live final on the adopted run and asserts it renders.Negative control (proves the assertion is real behavior, not a tautology): with the loader change reverted (
git stashofui/src/ui/controllers/chat.tsonly) and the same e2e run, the real browser never renders the partial and the test fails on exactly that visibility wait:PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH. The symmetric TUI fix (src/tui/tui-session-actions.ts) and the gateway already emitting boundedinFlightRuncorroborate the end-to-end behavior.Tests and validation
ui/src/ui/controllers/chat.test.ts): buffered in-flight text restored on reconnect; empty-text in-flight run adopted (streaming, not idle);inFlightRunwithout a run id ignored; a fresher live local run not clobbered by a stale snapshot.ui/src/ui/e2e/chat-flow.e2e.test.ts) rendering the real Control UI in a real browser (see proof above), with a verified negative control.node scripts/run-vitest.mjs ui/src/ui/controllers/chat.test.ts→ 121 passed.node scripts/run-vitest.mjs ui/src/ui/views/chat.test.ts ui/src/ui/chat/build-chat-items.test.ts→ 136 passed (related rendering/view suites green).oxlintandoxfmt --writeclean on all changed files.Risk checklist
ui/src/ui/controllers/chat.ts, +29 incl. comments / ~9 logic lines) plus tests; no gateway, wire-protocol, or HTTP-payload changes.inFlightRunsnapshot is already bounded by the gateway (boundInFlightRunSnapshotForChatHistory), so no unbounded reconnect payload is introduced by this UI-side change.