Repository navigation
refactor(gateway): interrupt at admission; sessions.steer delegates to chat.send - #126291
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 19, 2026, 7:28 AM ET / 11:28 UTC. ClawSweeper reviewWhat this changesThe PR routes session interruption through Merge readinessThe patch correctly centralizes interruption at Gateway admission while retaining the deprecated RPC adapter. It should remain open for normal exact-head validation before merge. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherGateway message admission decides whether a message begins immediately, queues, or interrupts work in a session. It coordinates reply operations, embedded agent runs, and lifecycle admissions so a replacement request waits for the exact prior owner before starting. flowchart LR
A[Client message request] --> B[Gateway admission]
B --> C{Interrupt mode}
C -->|No| D[Queue or start turn]
C -->|Yes| E[Capture active owner]
E --> F[Stop exact work]
F --> D
D --> G[Session and UI response]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -65, Tests -11, Docs 0. Total -76 across 25 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land after exact-head checks confirm the retained Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: focused tests define active reply, embedded-only, idle, and idempotent interruption scenarios, but none were run in this read-only review. Is this the best way to solve the issue? Yes: Gateway admission is the correct canonical owner boundary, and the adapter preserves the public legacy RPC instead of retaining duplicate interruption machines. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4af09d4961c9. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What 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 (2 earlier review cycles)
|
…o chat.send chat.send queueMode interrupt now aborts the captured current operation at the session-work admission owner (exact-instance abort, never a same-key successor) and dispatches the new turn after the abort settles; channel-originated interrupts share the same primitive. sessions.steer keeps its validation, sharing/access checks, and response shape but becomes a thin deprecated adapter over that path - its private inflight/retry and hard-abort machine is deleted. The Control UI /redirect command rides canonical chat.send. Compaction's use of the old hard-interrupt helper moves unchanged to session-run-interruption.ts.
110dc64 to
6961f2e
Compare
|
Merged via squash.
|
…o chat.send (openclaw#126291) * refactor(gateway): interrupt at admission; sessions.steer delegates to chat.send chat.send queueMode interrupt now aborts the captured current operation at the session-work admission owner (exact-instance abort, never a same-key successor) and dispatches the new turn after the abort settles; channel-originated interrupts share the same primitive. sessions.steer keeps its validation, sharing/access checks, and response shape but becomes a thin deprecated adapter over that path - its private inflight/retry and hard-abort machine is deleted. The Control UI /redirect command rides canonical chat.send. Compaction's use of the old hard-interrupt helper moves unchanged to session-run-interruption.ts. * fix(gateway): interrupt non-reply admissions
What Problem This Solves
The repo shipped two structurally different hard-interrupt boundaries for one intent:
sessions.steer's private abort/wait/dispatch machine (used only by Control UI/redirect) andchat.sendqueueMode: "interrupt"handled late at reply admission. Late interruption ran after unrelated context work; the private machine duplicated idempotency/inflight/abort policy and aborted by session key.Why This Change Was Made
Interruption now happens at the session-work admission owner via the captured-operation primitive (exact-instance abort per #125763; successor-safe), shared by gateway and channel-originated interrupts. When no reply-registry operation was captured, the new admission runs the lifecycle owner's
interruptSessionWorkAdmissionsfallback inside its own admission context, interrupting worker/plugin-style predecessors without aborting itself; captured registry operations never fall through to a raw session-key abort.sessions.steer(shipped RPC since v2026.4.1, <=2026.7 descriptor) keeps validation, sharing/access semantics, and byte-compatible response shape as a thin deprecated adapter; itsbeginSessionSteerInflightmachine is deleted./redirectrides canonicalchat.send(UI and gateway co-ship). Compaction's hard-interrupt helper is extracted unchanged tosession-run-interruption.ts.User Impact
/redirectbehavior is unchanged from the operator's chair (mocked-UI E2E video and screenshots below). Reply-backed interrupts abort only the captured run, so a queued interrupt cannot kill its successor; non-reply worker/plugin placements are interrupted through the admission lifecycle owner before the replacement turn dispatches.Evidence
Production +389/-454 (net -65), tests +259/-270 (net -11). Auto-reply 211, gateway 71, UI 329 + E2E 7 green;
check-changed, build, and Codex autoreview clean. The direct non-registry Gateway regression failed pre-fix with zero interrupts and now passes; the captured-operation successor-safety regression remains green.redirect-interrupt.mp4