Repository navigation
fix(ui): recover queued follow-ups from settled runs - #126180
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 9:12 AM ET / 13:12 UTC. ClawSweeper reviewWhat this changesThe PR records the browser-visible run that settled in Gateway session state, letting the Control UI drain a queued follow-up only when that exact run has ended. Merge readinessNo discrete correctness defect was found in the branch. This remains necessary because current main still only clears lifecycle ownership and lacks an exact terminal client-run fact; keep it open for maintainer review and validation on the current-main merge result. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherGateway lifecycle events update durable session rows, which the Control UI uses to track its active chat run. A matching terminal run identity clears the local busy state and allows the existing queued-message drain to continue. flowchart LR
Browser[Control UI chat]
Queue[Queued follow-up]
Gateway[Gateway lifecycle event]
Session[Durable session row]
Match{Exact run matches?}
Drain[Existing queue drain]
Sent[Follow-up sent]
Gateway --> Session
Browser --> Queue
Session --> Match
Queue --> Match
Match -->|yes| Drain
Drain --> Sent
Match -->|no| Queue
Decision needed
Why: The branch is cleanly mergeable but behind a substantially changed main, and local review could not read GitHub's merge ref to establish exact-result behavior. Before merge
Agent review detailsSecurityNone. PR surfaceSource +73, Tests +307, Other +4. Total +384 across 47 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one Gateway-owned terminal client-run fact and the existing UI queue drain; no net-neutral alternative is evident because persistence, recovery, reset, protocol projection, and UI matching must agree. Validate that path on the current-main merge result before merge. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main has no terminal client-run identity, while the browser regression test constructs the missed-terminal queued-follow-up path. The read-only checkout was not used to execute the test. Is this the best way to solve the issue? Unclear: the owner-boundary design is coherent and avoids a watchdog or fallback, but exact current-main merge-result behavior could not be inspected or run locally. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 066176351ebd. 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 (9 earlier review cycles; latest 8 shown)
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Co-authored-by: jesse-merhi <[email protected]>
Co-authored-by: jesse-merhi <[email protected]>
Co-authored-by: jesse-merhi <[email protected]>
Co-authored-by: jesse-merhi <[email protected]>
da495b8 to
d590534
Compare
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Co-authored-by: jesse-merhi <[email protected]>
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Land-ready evidence for exact head
Known proof gap: the browser proof uses the isolated Control UI/Gateway fixture rather than an external provider. This is a deterministic session-lifecycle boundary; no external API contract changed. |
|
Merged via squash.
|
* fix(ui): recover queued follow-ups from settled runs Co-authored-by: jesse-merhi <[email protected]> * fix(ui): preserve terminal client run ownership Co-authored-by: jesse-merhi <[email protected]> * fix(sessions): persist recovered terminal client runs Co-authored-by: jesse-merhi <[email protected]> * test(gateway): publish configured reply runtime Co-authored-by: jesse-merhi <[email protected]> * fix(protocol): refresh Swift session row Co-authored-by: jesse-merhi <[email protected]> --------- Co-authored-by: Ian Moog <[email protected]> Co-authored-by: jesse-merhi <[email protected]> Co-authored-by: Roboclaw <[email protected]>
Related: #42213
Supersedes #124054. This replacement preserves Ian Moog (@yanmo42) as the original commit author.
What Problem This Solves
Fixes an issue where a Control UI follow-up could stay stuck in Waiting for current run even though that run had already finished. This happened when the browser missed the terminal event, the Gateway restarted during admission, or the provider run ID differed from the run ID shown to the browser.
Why This Change Was Made
The Gateway now records which browser-visible run actually reached a terminal state. Provider run IDs remain separate and continue to fence lifecycle ownership. Restart recovery records the same terminal fact, and session resets clear it so a later session cannot inherit stale evidence.
The Control UI releases a queued follow-up only when that recorded terminal run exactly matches its local active run. It then uses the existing queue drain. This adds no watchdog, retry timer, compatibility fallback, configuration, or protocol-version bump.
User Impact
Queued follow-ups resume after the matching run finishes, even if the browser missed the terminal event. Active runs, unrelated runs, and replacement session generations are left alone.
Evidence
Before and after
Read the image from top to bottom:
The comparison uses the same fixture and viewport on both sides. It was captured in a real browser against an isolated Control UI test Gateway, not a live external provider.
Supporting validation
orionruntime; the owner-aligned fixture repair passes 116/116 on current main and this branch.pnpm check:changed: exit 0; types, test types, lint, database-first, schema, import-cycle, and architecture guards passed.Change Breakdown
The production growth records one authoritative terminal client-run fact at its lifecycle owners and projects it to the existing UI recovery boundary. The later commits complete review-requested restart and reset ownership; they do not add a second recovery path.
AI-assisted: yes. The repository autoreview workflow reviewed the final branch. Ian Moog remains the original commit author.
Exact head:
f5a180f45a63fca48b705fbea6147bacae3e9cb2.