Repository navigation
fix(auto-reply): queue instead of steering after a terminal source-reply receipt - #129001
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 3:13 PM ET / 19:13 UTC (Revision 24). ClawSweeper reviewWhat this changesQueues late input as a fresh turn when the active turn cannot deliver another reply, and makes queued delivery publish one terminal completion. Merge readiness✅ Ready for maintainer review This remains a useful fix: current main lacks the terminal-receipt steering guard. The prior findings are addressed, the latest commit changes only test handling, and no blocking correctness defect was found. Priority: P1 Review scores
Verification
How this fits togetherOpenClaw’s reply pipeline either injects incoming messages into an active agent turn or queues them for later execution. Delivery receipts prevent duplicate sends, while Gateway completion events tell connected clients when replies finish. flowchart TD
A[Incoming message] --> B[Active turn and receipt check]
B -->|Eligible| C[Steer active turn]
B -->|Terminal or uncertain| D[Ordered follow-up queue]
D --> E[Fresh agent turn]
E --> F[Reply delivery owner]
F --> G[Transport reply and terminal event]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +576, Tests +2302. Total +2878 across 36 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep receipt deduplication intact while giving ineligible late input a fresh queued turn whose delivery owner records exactly one completion. Do we have a high-confidence way to reproduce the issue? Yes for the narrow late-steering mechanism: current source permits injection after terminal delivery, and the supplied baseline documents the resulting missing reply. This review did not execute a new current-main reproduction. Is this the best way to solve the issue? Yes. The patch reuses the receipt decision and ordered queue, preserves exact-operation admission, and assigns terminal publication to the delivery owner without adding configuration or changing stored formats. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5b097c8b41ae. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (23 earlier review cycles; latest 8 shown)
|
|
@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. |
|
CI triage — shard failures trace to main's red window (now recovered), not this diff
Completed CI runs don't auto-refresh, so a re-run of the failed jobs against current main should turn these checks green. No product failure is attributable to this PR's changes. |
|
Hi @steipete @vincentkoc — follow-up on my CI triage comment above: main's red window is now closed. push-to-main CI has been fully green since 12:38Z today:
This PR's head ( As an external contributor I have no write access to rerun failed jobs myself — could you please rerun the failed jobs on this PR? Thanks! |
8967104 to
0d3ee55
Compare
|
Rebased onto the latest
@steipete could you please re-run the failed CI jobs? Thanks! |
a603003 to
4691a82
Compare
|
Addressed the round-5 ClawSweeper review (verdict on head 1. [P1] Scope tombstone checks to the active source turn — fixed. The fail-closed classifier now takes the active source-turn identity and scopes the terminal-tombstone condition to that exact source:
2. Real behavior proof (ephemeral-gateway trace) — constraint statement instead of a fabricated trace. A redacted ephemeral-gateway run cannot be produced on this host, and I'm stating the mechanism rather than faking one:
3. Merge-risk items 3–5 are the same P1 and proof items above. Item 6 (P2) is covered by the same regression set. Test results on this host (branch head
The PR body has been updated with the P1 fix description, the red → green evidence, and the trace constraint statement. Please re-review when convenient — @clawsweeper re-review. |
…nclaw#128971) - import forceClearReplyOperation from reply-run-registry.state.js, its owning module: the isolated-gateway proof called it from the operation module that does not export it, so the inter-test cleanup was a no-op and the next createReplyOperation threw ReplyRunAlreadyActiveError (TS2459) - rename the nested steer fixture to makeSteerStarterParams so it no longer shadows the outer makeStarterParams (oxlint no-shadow at 410:12) - give that fixture the session fields the steer path reads (sessionKey/storePath/clientRunId) plus a logGateway stub (TS2739)
|
Pushed 1. 2.
3. Local verification (worktree at
|
|
Follow-up on
Still red on this run, both unrelated to this PR (generated-docs navigation drift, no docs/generated files in the diff):
|
|
Thanks @Finn763! Proof: An authenticated loopback Gateway test reproduced accepted late input losing its terminal reply. The repaired flow produced one transport reply and one content-bearing WebSocket final under a fresh follow-up turn. Normal steering and unrelated-receipt controls passed, with independent behavior validation and exact-head source review.
Focused owner, lifecycle, and cleanup checks passed. Hosted CI passed for the landed head. The proof used a controlled local model endpoint and synthetic channel transport. Issue #128971 remains open for delivery-ambiguity paths outside this repair. |
Related to #128971.
What Problem This Solves
A message sent near the end of an active turn could receive no reply because steering reused that turn's completed delivery claim.
Why This Change Was Made
Steering checks the current terminal receipt immediately before the runtime takes the input. An ineligible message stays in the ordered follow-up queue and receives its own turn. Source bindings belong to the exact active operation, and input already accepted by a runtime is never replayed.
The queued reply owner publishes completion once, after reply delivery settles. Progress continues while success, silence, failure, timeout, and cancellation retain a terminal outcome. Stream tails, partial abort replies, canvas output, and source-recovery callback custody are preserved.
User Impact
Late messages receive one follow-up reply. Normal steering and steering past an unrelated old receipt continue to work. Ambiguous or stale terminal delivery remains fail-closed.
Evidence
chat.sendaccepted a new message into an active channel turn with an owner-prepared retained terminal receipt. The actual terminal message-tool attempt returnedalready-delivered; the new message received no expected transport reply or content-bearing WebSocket final.This repair preserves Finn763's original contribution and all 19 commits.