Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 12:52 PM ET / 16:52 UTC. ClawSweeper reviewWhat this changesThe PR adds a bounded Control UI outbox watchdog that queries an exact stalled run, reloads the visible transcript, and resumes FIFO follow-up delivery when terminal events were missed. Regression provenancePossible regression — suspected (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep this PR open as the live fix path for the linked Control UI queue stall. No discrete correctness finding emerged; merge after the current-base result and remaining exact-head checks are green. Priority: P1 Review scores
Verification
How this fits togetherControl UI chat persists queued follow-ups in a durable browser outbox while the Gateway owns run state and transcript history. Normally terminal events release that queue; the new recovery path asks the Gateway for authoritative terminal state when those events never reach the browser. flowchart LR
User[Queued follow-up] --> Outbox[Durable chat outbox]
Outbox --> Watchdog[Recovery watchdog]
Watchdog --> Gateway[Gateway run status]
Gateway --> Decision{Run terminal?}
Decision -->|No| Watchdog
Decision -->|Yes| History[Reload visible history]
History --> Delivery[Resume FIFO delivery]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +201, Tests +1004, Config +13. Total +1218 across 9 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the durable-outbox-owned recovery flow, and merge it only after the merged result against current main passes its exact-head browser and required CI checks. Do we have a high-confidence way to reproduce the issue? Yes—source-reproducible with high confidence: the added real-Gateway browser scenario drops terminal and idle session frames, then verifies the formerly stuck FIFO follow-up is sent only after authoritative recovery. Is this the best way to solve the issue? Yes. Recovery belongs to the durable outbox because it owns blocked FIFO work; an event-handler-only retry cannot run when the relevant events were missed, while changing Gateway protocol would be broader than needed. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2d9a3f5849c9. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
2a59d74 to
dc757aa
Compare
dc757aa to
df387db
Compare
Co-authored-by: Siew's Capital Jarvis <[email protected]>
df387db to
bf2f75f
Compare
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix: queued chat follow-ups stay stuck after missed terminal events This is item 1/1 in the current shard. Shard 31/41. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Superseded by #126180. The replacement preserves Ian Moog's commit authorship while narrowing recovery to one canonical lifecycle fact: the exact last terminal run ID is recorded by the Gateway and consumed by the Control UI to release only the matching settled run. This removes the browser-watchdog/fallback path and keeps queued-send recovery at the owning state boundary. |
Closes #42213
What Problem This Solves
Fixes an issue where Control UI users who queued a follow-up during an active run could see it remain stuck indefinitely when the browser missed both the run's terminal event and the later session-state update.
Why This Change Was Made
Adds a bounded exact-run recovery watchdog owned by the durable chat outbox. It waits before probing the authoritative
agent.waitstate, keeps active or ambiguous runs queued, replaces stale watches across logical reconnects, and preserves canonical done, timeout, cancellation, and yielded session outcomes before reloading history and resuming FIFO delivery.The live proof also exposed an alias boundary hidden by mocks: the durable main-session outbox is stored under
global+ agent, while a per-sender Gateway can keep its transcript atagent:<id>:main. Visible global outboxes now reconcile through the visible canonical Gateway route, preventing an already-delivered head from becomingunconfirmedand blocking later FIFO rows. Background outboxes retain their own routing.The positive production delta (+207/-6 lines) is the watchdog capability, its isolated lifecycle owner, and the canonical visible-history reconciliation. The watchdog is scoped only to visible durable outboxes with blocked work and adds no protocol or configuration surface.
Carries forward the recovery direction from #42258 and #90618; contributor attribution is preserved in the commit trailer.
User Impact
Queued follow-ups recover automatically after missed terminal/session events instead of requiring another prompt or page intervention. Active runs remain protected from premature sends, reconnects preserve recovery, and main-session aliases no longer strand delivered queue heads.
Real Behavior Proof
Added a deterministic real-stack test at
ui/src/e2e/chat-flow.real-gateway.e2e.test.ts. It uses:chat,session.message, andsessions.changedframes while preserving the connection sequence.Observed after-fix trace (run IDs redacted):
This first ran red against the prior patch:
agent.waitand canonical history reload succeeded, but outbox reconciliation queried the persistedglobalalias, marked the delivered first rowunconfirmed, and left the follow-up atsendAttempts: 0. The canonical visible-history fix makes the same real setup pass.Exact-head CI passed
checks-ui-e2e-real-gatewayand uploadedcontrol-ui-real-gateway-proof-1for seven days. The 1.48 MB artifact contains the redacted JSON trace, before/after screenshots, and browser video.Evidence
OPENCLAW_CAPTURE_UI_PROOF=1 OPENCLAW_UI_E2E_ARTIFACT_DIR=.artifacts/pr124054-real-proof node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-flow.real-gateway.e2e.test.ts— 1 passed.node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-flow.real-gateway.e2e.test.ts ui/src/e2e/control-ui-auth-transports.e2e.test.ts— 3 passed.node scripts/run-vitest.mjs ui/src/pages/chat/chat-send.test.ts— 303 passed.node scripts/run-vitest.mjs test/scripts/ci-workflow-guards.test.ts -t 'gates current Control UI changes'— 1 passed.pnpm --dir ui test— 658 files passed, 9,464 tests passed, 1 skipped.