Repository navigation
fix: preserve running tools when steering receipts are uncertain - #166754
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 October 8, 2026, 4:37 AM ET / 08:37 UTC (Revision 7). ClawSweeper reviewWhat this changesThe branch reports uncertain steering receipts without canceling running tools or replaying the retained input. Example: Send ordinary steering while a native command is blocked on a FIFO.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR remains necessary and is ready for normal landing review: current main still cancels running work on uncertain receipts, while exact-head live proof demonstrates recovery without cancellation or replay. No actionable findings remain. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherSteering adds a user's message to an already-running agent turn. The shared reply owner reconciles backend acceptance with receipt confirmation, then tells Gateway and channel callers whether to report success, uncertainty, or a safe fallback. flowchart TD
A[User sends steering] --> B[Gateway or channel admission]
B --> C[Captured active reply owner]
C --> D[Runtime accepts input]
D --> E{Receipt confirmed?}
E -->|Yes| F[Report accepted steering]
E -->|Uncertain| G[Report uncertainty and retain input]
G --> H[Running tools continue without replay]
Technical reviewBest possible solution: Keep one non-replayable uncertainty policy in the shared reply owner while preserving explicit stop and captured-owner adoption cancellation. Do we have a high-confidence way to reproduce the issue? Yes. Current source establishes the abort trigger, and the recorded real Gateway/native Codex comparison reproduces it on a main baseline with identical affected production code; this read-only review did not execute target code. Is this the best way to solve the issue? Yes. Normalizing uncertainty at the shared owner removes inconsistent cancellation policy without adding configuration, changing backend receipt APIs, or creating another fallback path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4dc47557f10d. Provenance checked
TestingProof path: shipped entry point. Added test files: 5. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -28, Tests +129, Docs +1. Total +102 across 10 files. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (6 earlier review cycles)
|
7ea26e5 to
3157059
Compare
|
Merged via squash.
|
…nclaw#166754) * fix: preserve running tools when steering receipts are uncertain * test(gateway): expect uncertain steering error receipt
Root cause: `src/auto-reply/reply/agent-runner-steer-adoption.ts:451` returned the runtime's raw receipt error (`finalization.outcome.errorMessage`) as the chat reply when a steered message's receipt stayed unconfirmed. Related: #207117 ## What Problem This Solves When a chat run is stuck in a long tool call, every message the person sends meanwhile is steered into that run. One example is a Codex run waiting up to 10 minutes for an OpenClaw change approval. Codex accepts each message but reads it only after the tool call returns. After 60 seconds the steering receipt times out, and the chat later gets the runtime's internal error once per message: `Codex accepted steering but did not confirm transcript consumption | Codex steering transcript consumption confirmation timed out`. In the reported case, one WhatsApp chat got four copies. ## User Impact The person now gets a plain notice instead: "OpenClaw could not confirm that input. It was not sent again; check the conversation before retrying." Talk already uses this wording for the same state. The runtime's error moves to the Gateway diagnostic log as a warning. Input custody is unchanged: the message is not replayed, the running tool is not interrupted, and the runtime still reads the message when it can. This covers every runtime that steering reaches. For example, a backend that fails after accepting input also stopped sending its raw error text. Not fixed here: each steered message still gets its own notice, so four messages still give four notices. #207117 also asks for at most one per run. That needs a change in the dispatcher too: if steering returns no reply, the dispatcher's missing-reply fallback can send a generic notice instead. I left that for a follow-up, so this PR does not close the issue. ## Why This Change Was Made Channel steering in `runActiveReplySteer` delivers the indeterminate outcome's `errorMessage` to the sender as the reply. That field holds whatever the runtime reported: Codex's joined cause chain, a backend error, or the question path's plain message. This PR fixes it at that presentation boundary. One fixed notice there covers every runtime. Fixing each producer would leave the next producer to leak the same way. I kept a visible notice rather than dropping the reply. #166754 surfaces receipt uncertainty on purpose, and the notice tells the person their message was not lost and should not be resent. Suppressing the reply would also run into the missing-reply fallback above. Queueing the message as a new turn would break the no-replay rule that #166754 and #184062 enforce, because the runtime already holds the input. The question-answer path (`agent-runner-question-input.ts`) is unchanged. It already delivers `QuestionAnswerUnconfirmedError`'s plain message. On the steering path, question answers now get the generic notice. Both texts end with the same "It was not sent again; check the conversation before retrying." The issue's code pointer named the question path. The reported text actually comes from `CodexSteeringAcceptedUnconfirmedError` in `extensions/codex/src/app-server/attempt-steering.ts`, through this steering path. ## Evidence - **Production (OpenClaw 2026.11.10, Codex harness, WhatsApp DM, Default agent without `tools.openclaw.autoApproveChanges`):** four messages sent during a 600-second approval wait each produced `reason=question-response-indeterminate` about 60 seconds after dispatch. When the run ended, the chat got four copies of the error above. All four messages were in the Codex transcript by then. - **Codex source check (`openai/codex` main, 2026-11-25):** in `codex-rs/core/src/stream_events_utils.rs`, accepted steer input goes into the turn's `pending_input`, which is read only between model steps. A steered message therefore waits for the running tool call, as observed. - **Regression test, red on `main`, green with this change:** `agent-runner-steer-adoption.question-recovery.test.ts` ("retains accepted input until its unconfirmed / backend-error outcome settles") drives `runActiveReplySteer` against a backend that accepts input, then reports an unconfirmed receipt or fails. On `main`, the reply text is the runtime's error (`transcript confirmation lost`, `backend failed after accepting input`). With the fix, it is the plain notice. The test previously asserted the raw passthrough. Custody assertions in the same test are unchanged: admission stays `question-response-indeterminate`, no followup, no cancel, no abort. - **Updated test:** `agent-runner-steer-adoption.question-receipts.test.ts` asserts the shared "not sent again" sentence on both entry points, instead of the question-only wording. - **Checks:** the 44 steering-related `src/auto-reply/reply` test files pass. So do the nearby gateway `chat.send`, Talk, TUI and subagent-announce suites, `pnpm tsgo:core`, `pnpm tsgo:core:test`, oxfmt, oxlint and `git diff --check`. - **Live WhatsApp proof (2026-11-29), before and after.** Both Gateways were built from source (`pnpm build`, `openclaw gateway run`): `2777a47` (the parent commit, without this change) and `1617d01` (this PR). Each ran with an isolated state directory, a real WhatsApp account linked in self-chat mode, `openai/gpt-5.5` on the native Codex harness (bundled app-server 0.172.0), and `tools.openclaw.autoApproveChanges: false`. Both runs followed the same steps, and the chat text below was read from a separately linked device's message store: 1. Message 1 asks the agent to set `ui.assistant.name` through the `openclaw` tool. The tool posts the approval prompt and blocks while it waits. 2. During that wait, message 2 arrives (`what's 2+2?` before, `what's 3+3?` after) and is steered into the active run. 3. About 60 seconds later the Gateway logs `message dispatch completed ... outcome=error duration=60881ms reason=question-response-indeterminate` (60666 ms after the fix). 4. `/approve <id> deny` sent from the chat ends the wait, and the run finishes. Chat after the run ends: | | Before (`2777a47`) | After (`1617d01`) | | --- | --- | --- | | Agent reply | `"PROOF-207150-B: also, what's 2+2?" 2+2 = 4. Config change was denied.` | `Denied. Meanwhile you said: "PROOF-207150-D: also, what's 3+3?" 3+3=6.` | | Steering outcome sent to the chat | `Codex accepted steering but did not confirm transcript consumption \| Codex steering transcript consumption confirmation timed out` | `OpenClaw could not confirm that input. It was not sent again; check the conversation before retrying.` | | Gateway log | no warning | `steering receipt unconfirmed; input kept without replay error="Codex accepted steering but did not confirm transcript consumption \| Codex steering transcript consumption confirmation timed out"` | On both builds the runtime consumed the steered message and the agent answered it inside the same run. Each Gateway log shows one run ID, with no followup turn, abort or replay. The pending tool call was not interrupted: it returned only when the approval was denied. The Control UI is not affected; it shows its own "send failed" text for this ack. 🤖 Generated with [Claude Code](https://claude.com/claude-code) ## Maintainer follow-up - Channel steering and Talk now read one `AGENT_INPUT_UNCONFIRMED_MESSAGE` from `src/talk/agent-run-control-shared.ts`, Talk's existing message owner. The second copy of the text is gone, and the wording is unchanged. - Gateway proof (qa-channel, real Codex app-server, approval wait, native `/steer`), before, after and control: #207150 (comment) Merge danger: two-way door. Only the reply text and one bounded diagnostic log line change, with no state or contract change. A revert fully undoes it. Co-authored-by: Ayaan Zaidi <[email protected]>
Root cause: `src/auto-reply/reply/agent-runner-steer-adoption.ts:451` returned the runtime's raw receipt error (`finalization.outcome.errorMessage`) as the chat reply when a steered message's receipt stayed unconfirmed. Related: #207117 ## What Problem This Solves When a chat run is stuck in a long tool call, every message the person sends meanwhile is steered into that run. One example is a Codex run waiting up to 10 minutes for an OpenClaw change approval. Codex accepts each message but reads it only after the tool call returns. After 60 seconds the steering receipt times out, and the chat later gets the runtime's internal error once per message: `Codex accepted steering but did not confirm transcript consumption | Codex steering transcript consumption confirmation timed out`. In the reported case, one WhatsApp chat got four copies. ## User Impact The person now gets a plain notice instead: "OpenClaw could not confirm that input. It was not sent again; check the conversation before retrying." Talk already uses this wording for the same state. The runtime's error moves to the Gateway diagnostic log as a warning. Input custody is unchanged: the message is not replayed, the running tool is not interrupted, and the runtime still reads the message when it can. This covers every runtime that steering reaches. For example, a backend that fails after accepting input also stopped sending its raw error text. Not fixed here: each steered message still gets its own notice, so four messages still give four notices. #207117 also asks for at most one per run. That needs a change in the dispatcher too: if steering returns no reply, the dispatcher's missing-reply fallback can send a generic notice instead. I left that for a follow-up, so this PR does not close the issue. ## Why This Change Was Made Channel steering in `runActiveReplySteer` delivers the indeterminate outcome's `errorMessage` to the sender as the reply. That field holds whatever the runtime reported: Codex's joined cause chain, a backend error, or the question path's plain message. This PR fixes it at that presentation boundary. One fixed notice there covers every runtime. Fixing each producer would leave the next producer to leak the same way. I kept a visible notice rather than dropping the reply. #166754 surfaces receipt uncertainty on purpose, and the notice tells the person their message was not lost and should not be resent. Suppressing the reply would also run into the missing-reply fallback above. Queueing the message as a new turn would break the no-replay rule that #166754 and #184062 enforce, because the runtime already holds the input. The question-answer path (`agent-runner-question-input.ts`) is unchanged. It already delivers `QuestionAnswerUnconfirmedError`'s plain message. On the steering path, question answers now get the generic notice. Both texts end with the same "It was not sent again; check the conversation before retrying." The issue's code pointer named the question path. The reported text actually comes from `CodexSteeringAcceptedUnconfirmedError` in `extensions/codex/src/app-server/attempt-steering.ts`, through this steering path. ## Evidence - **Production (OpenClaw 2026.11.10, Codex harness, WhatsApp DM, Default agent without `tools.openclaw.autoApproveChanges`):** four messages sent during a 600-second approval wait each produced `reason=question-response-indeterminate` about 60 seconds after dispatch. When the run ended, the chat got four copies of the error above. All four messages were in the Codex transcript by then. - **Codex source check (`openai/codex` main, 2026-11-25):** in `codex-rs/core/src/stream_events_utils.rs`, accepted steer input goes into the turn's `pending_input`, which is read only between model steps. A steered message therefore waits for the running tool call, as observed. - **Regression test, red on `main`, green with this change:** `agent-runner-steer-adoption.question-recovery.test.ts` ("retains accepted input until its unconfirmed / backend-error outcome settles") drives `runActiveReplySteer` against a backend that accepts input, then reports an unconfirmed receipt or fails. On `main`, the reply text is the runtime's error (`transcript confirmation lost`, `backend failed after accepting input`). With the fix, it is the plain notice. The test previously asserted the raw passthrough. Custody assertions in the same test are unchanged: admission stays `question-response-indeterminate`, no followup, no cancel, no abort. - **Updated test:** `agent-runner-steer-adoption.question-receipts.test.ts` asserts the shared "not sent again" sentence on both entry points, instead of the question-only wording. - **Checks:** the 44 steering-related `src/auto-reply/reply` test files pass. So do the nearby gateway `chat.send`, Talk, TUI and subagent-announce suites, `pnpm tsgo:core`, `pnpm tsgo:core:test`, oxfmt, oxlint and `git diff --check`. - **Live WhatsApp proof (2026-11-29), before and after.** Both Gateways were built from source (`pnpm build`, `openclaw gateway run`): `2777a47` (the parent commit, without this change) and `1617d01` (this PR). Each ran with an isolated state directory, a real WhatsApp account linked in self-chat mode, `openai/gpt-5.5` on the native Codex harness (bundled app-server 0.172.0), and `tools.openclaw.autoApproveChanges: false`. Both runs followed the same steps, and the chat text below was read from a separately linked device's message store: 1. Message 1 asks the agent to set `ui.assistant.name` through the `openclaw` tool. The tool posts the approval prompt and blocks while it waits. 2. During that wait, message 2 arrives (`what's 2+2?` before, `what's 3+3?` after) and is steered into the active run. 3. About 60 seconds later the Gateway logs `message dispatch completed ... outcome=error duration=60881ms reason=question-response-indeterminate` (60666 ms after the fix). 4. `/approve <id> deny` sent from the chat ends the wait, and the run finishes. Chat after the run ends: | | Before (`2777a47`) | After (`1617d01`) | | --- | --- | --- | | Agent reply | `"PROOF-207150-B: also, what's 2+2?" 2+2 = 4. Config change was denied.` | `Denied. Meanwhile you said: "PROOF-207150-D: also, what's 3+3?" 3+3=6.` | | Steering outcome sent to the chat | `Codex accepted steering but did not confirm transcript consumption \| Codex steering transcript consumption confirmation timed out` | `OpenClaw could not confirm that input. It was not sent again; check the conversation before retrying.` | | Gateway log | no warning | `steering receipt unconfirmed; input kept without replay error="Codex accepted steering but did not confirm transcript consumption \| Codex steering transcript consumption confirmation timed out"` | On both builds the runtime consumed the steered message and the agent answered it inside the same run. Each Gateway log shows one run ID, with no followup turn, abort or replay. The pending tool call was not interrupted: it returned only when the approval was denied. The Control UI is not affected; it shows its own "send failed" text for this ack. 🤖 Generated with [Claude Code](https://claude.com/claude-code) ## Maintainer follow-up - Channel steering and Talk now read one `AGENT_INPUT_UNCONFIRMED_MESSAGE` from `src/talk/agent-run-control-shared.ts`, Talk's existing message owner. The second copy of the text is gone, and the wording is unchanged. - Gateway proof (qa-channel, real Codex app-server, approval wait, native `/steer`), before, after and control: #207150 (comment) Merge danger: two-way door. Only the reply text and one bounded diagnostic log line change, with no state or contract change. A revert fully undoes it. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 95fada2) Release adaptation: Keep the two existing end-to-end assertions within the release line-cap; the focused question-recovery suite still asserts the complete public message. Co-authored-by: RomneyDa <[email protected]>
Root cause: `src/auto-reply/reply/agent-runner-steer-adoption.ts:451` returned the runtime's raw receipt error (`finalization.outcome.errorMessage`) as the chat reply when a steered message's receipt stayed unconfirmed. Related: #207117 ## What Problem This Solves When a chat run is stuck in a long tool call, every message the person sends meanwhile is steered into that run. One example is a Codex run waiting up to 10 minutes for an OpenClaw change approval. Codex accepts each message but reads it only after the tool call returns. After 60 seconds the steering receipt times out, and the chat later gets the runtime's internal error once per message: `Codex accepted steering but did not confirm transcript consumption | Codex steering transcript consumption confirmation timed out`. In the reported case, one WhatsApp chat got four copies. ## User Impact The person now gets a plain notice instead: "OpenClaw could not confirm that input. It was not sent again; check the conversation before retrying." Talk already uses this wording for the same state. The runtime's error moves to the Gateway diagnostic log as a warning. Input custody is unchanged: the message is not replayed, the running tool is not interrupted, and the runtime still reads the message when it can. This covers every runtime that steering reaches. For example, a backend that fails after accepting input also stopped sending its raw error text. Not fixed here: each steered message still gets its own notice, so four messages still give four notices. #207117 also asks for at most one per run. That needs a change in the dispatcher too: if steering returns no reply, the dispatcher's missing-reply fallback can send a generic notice instead. I left that for a follow-up, so this PR does not close the issue. ## Why This Change Was Made Channel steering in `runActiveReplySteer` delivers the indeterminate outcome's `errorMessage` to the sender as the reply. That field holds whatever the runtime reported: Codex's joined cause chain, a backend error, or the question path's plain message. This PR fixes it at that presentation boundary. One fixed notice there covers every runtime. Fixing each producer would leave the next producer to leak the same way. I kept a visible notice rather than dropping the reply. #166754 surfaces receipt uncertainty on purpose, and the notice tells the person their message was not lost and should not be resent. Suppressing the reply would also run into the missing-reply fallback above. Queueing the message as a new turn would break the no-replay rule that #166754 and #184062 enforce, because the runtime already holds the input. The question-answer path (`agent-runner-question-input.ts`) is unchanged. It already delivers `QuestionAnswerUnconfirmedError`'s plain message. On the steering path, question answers now get the generic notice. Both texts end with the same "It was not sent again; check the conversation before retrying." The issue's code pointer named the question path. The reported text actually comes from `CodexSteeringAcceptedUnconfirmedError` in `extensions/codex/src/app-server/attempt-steering.ts`, through this steering path. ## Evidence - **Production (OpenClaw 2026.11.10, Codex harness, WhatsApp DM, Default agent without `tools.openclaw.autoApproveChanges`):** four messages sent during a 600-second approval wait each produced `reason=question-response-indeterminate` about 60 seconds after dispatch. When the run ended, the chat got four copies of the error above. All four messages were in the Codex transcript by then. - **Codex source check (`openai/codex` main, 2026-11-25):** in `codex-rs/core/src/stream_events_utils.rs`, accepted steer input goes into the turn's `pending_input`, which is read only between model steps. A steered message therefore waits for the running tool call, as observed. - **Regression test, red on `main`, green with this change:** `agent-runner-steer-adoption.question-recovery.test.ts` ("retains accepted input until its unconfirmed / backend-error outcome settles") drives `runActiveReplySteer` against a backend that accepts input, then reports an unconfirmed receipt or fails. On `main`, the reply text is the runtime's error (`transcript confirmation lost`, `backend failed after accepting input`). With the fix, it is the plain notice. The test previously asserted the raw passthrough. Custody assertions in the same test are unchanged: admission stays `question-response-indeterminate`, no followup, no cancel, no abort. - **Updated test:** `agent-runner-steer-adoption.question-receipts.test.ts` asserts the shared "not sent again" sentence on both entry points, instead of the question-only wording. - **Checks:** the 44 steering-related `src/auto-reply/reply` test files pass. So do the nearby gateway `chat.send`, Talk, TUI and subagent-announce suites, `pnpm tsgo:core`, `pnpm tsgo:core:test`, oxfmt, oxlint and `git diff --check`. - **Live WhatsApp proof (2026-11-29), before and after.** Both Gateways were built from source (`pnpm build`, `openclaw gateway run`): `2777a47` (the parent commit, without this change) and `1617d01` (this PR). Each ran with an isolated state directory, a real WhatsApp account linked in self-chat mode, `openai/gpt-5.5` on the native Codex harness (bundled app-server 0.172.0), and `tools.openclaw.autoApproveChanges: false`. Both runs followed the same steps, and the chat text below was read from a separately linked device's message store: 1. Message 1 asks the agent to set `ui.assistant.name` through the `openclaw` tool. The tool posts the approval prompt and blocks while it waits. 2. During that wait, message 2 arrives (`what's 2+2?` before, `what's 3+3?` after) and is steered into the active run. 3. About 60 seconds later the Gateway logs `message dispatch completed ... outcome=error duration=60881ms reason=question-response-indeterminate` (60666 ms after the fix). 4. `/approve <id> deny` sent from the chat ends the wait, and the run finishes. Chat after the run ends: | | Before (`2777a47`) | After (`1617d01`) | | --- | --- | --- | | Agent reply | `"PROOF-207150-B: also, what's 2+2?" 2+2 = 4. Config change was denied.` | `Denied. Meanwhile you said: "PROOF-207150-D: also, what's 3+3?" 3+3=6.` | | Steering outcome sent to the chat | `Codex accepted steering but did not confirm transcript consumption \| Codex steering transcript consumption confirmation timed out` | `OpenClaw could not confirm that input. It was not sent again; check the conversation before retrying.` | | Gateway log | no warning | `steering receipt unconfirmed; input kept without replay error="Codex accepted steering but did not confirm transcript consumption \| Codex steering transcript consumption confirmation timed out"` | On both builds the runtime consumed the steered message and the agent answered it inside the same run. Each Gateway log shows one run ID, with no followup turn, abort or replay. The pending tool call was not interrupted: it returned only when the approval was denied. The Control UI is not affected; it shows its own "send failed" text for this ack. 🤖 Generated with [Claude Code](https://claude.com/claude-code) ## Maintainer follow-up - Channel steering and Talk now read one `AGENT_INPUT_UNCONFIRMED_MESSAGE` from `src/talk/agent-run-control-shared.ts`, Talk's existing message owner. The second copy of the text is gone, and the wording is unchanged. - Gateway proof (qa-channel, real Codex app-server, approval wait, native `/steer`), before, after and control: #207150 (comment) Merge danger: two-way door. Only the reply text and one bounded diagnostic log line change, with no state or contract change. A revert fully undoes it. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 95fada2) Companion audit: No later same-path, PR, or source-SHA follow-up found through pinned main. Co-authored-by: RomneyDa <[email protected]>
Root cause: `src/auto-reply/reply/agent-runner-steer-adoption.ts:451` returned the runtime's raw receipt error (`finalization.outcome.errorMessage`) as the chat reply when a steered message's receipt stayed unconfirmed. Related: openclaw#207117 ## What Problem This Solves When a chat run is stuck in a long tool call, every message the person sends meanwhile is steered into that run. One example is a Codex run waiting up to 10 minutes for an OpenClaw change approval. Codex accepts each message but reads it only after the tool call returns. After 60 seconds the steering receipt times out, and the chat later gets the runtime's internal error once per message: `Codex accepted steering but did not confirm transcript consumption | Codex steering transcript consumption confirmation timed out`. In the reported case, one WhatsApp chat got four copies. ## User Impact The person now gets a plain notice instead: "OpenClaw could not confirm that input. It was not sent again; check the conversation before retrying." Talk already uses this wording for the same state. The runtime's error moves to the Gateway diagnostic log as a warning. Input custody is unchanged: the message is not replayed, the running tool is not interrupted, and the runtime still reads the message when it can. This covers every runtime that steering reaches. For example, a backend that fails after accepting input also stopped sending its raw error text. Not fixed here: each steered message still gets its own notice, so four messages still give four notices. openclaw#207117 also asks for at most one per run. That needs a change in the dispatcher too: if steering returns no reply, the dispatcher's missing-reply fallback can send a generic notice instead. I left that for a follow-up, so this PR does not close the issue. ## Why This Change Was Made Channel steering in `runActiveReplySteer` delivers the indeterminate outcome's `errorMessage` to the sender as the reply. That field holds whatever the runtime reported: Codex's joined cause chain, a backend error, or the question path's plain message. This PR fixes it at that presentation boundary. One fixed notice there covers every runtime. Fixing each producer would leave the next producer to leak the same way. I kept a visible notice rather than dropping the reply. openclaw#166754 surfaces receipt uncertainty on purpose, and the notice tells the person their message was not lost and should not be resent. Suppressing the reply would also run into the missing-reply fallback above. Queueing the message as a new turn would break the no-replay rule that openclaw#166754 and openclaw#184062 enforce, because the runtime already holds the input. The question-answer path (`agent-runner-question-input.ts`) is unchanged. It already delivers `QuestionAnswerUnconfirmedError`'s plain message. On the steering path, question answers now get the generic notice. Both texts end with the same "It was not sent again; check the conversation before retrying." The issue's code pointer named the question path. The reported text actually comes from `CodexSteeringAcceptedUnconfirmedError` in `extensions/codex/src/app-server/attempt-steering.ts`, through this steering path. ## Evidence - **Production (OpenClaw 2026.11.10, Codex harness, WhatsApp DM, Default agent without `tools.openclaw.autoApproveChanges`):** four messages sent during a 600-second approval wait each produced `reason=question-response-indeterminate` about 60 seconds after dispatch. When the run ended, the chat got four copies of the error above. All four messages were in the Codex transcript by then. - **Codex source check (`openai/codex` main, 2026-11-25):** in `codex-rs/core/src/stream_events_utils.rs`, accepted steer input goes into the turn's `pending_input`, which is read only between model steps. A steered message therefore waits for the running tool call, as observed. - **Regression test, red on `main`, green with this change:** `agent-runner-steer-adoption.question-recovery.test.ts` ("retains accepted input until its unconfirmed / backend-error outcome settles") drives `runActiveReplySteer` against a backend that accepts input, then reports an unconfirmed receipt or fails. On `main`, the reply text is the runtime's error (`transcript confirmation lost`, `backend failed after accepting input`). With the fix, it is the plain notice. The test previously asserted the raw passthrough. Custody assertions in the same test are unchanged: admission stays `question-response-indeterminate`, no followup, no cancel, no abort. - **Updated test:** `agent-runner-steer-adoption.question-receipts.test.ts` asserts the shared "not sent again" sentence on both entry points, instead of the question-only wording. - **Checks:** the 44 steering-related `src/auto-reply/reply` test files pass. So do the nearby gateway `chat.send`, Talk, TUI and subagent-announce suites, `pnpm tsgo:core`, `pnpm tsgo:core:test`, oxfmt, oxlint and `git diff --check`. - **Live WhatsApp proof (2026-11-29), before and after.** Both Gateways were built from source (`pnpm build`, `openclaw gateway run`): `7760906` (the parent commit, without this change) and `1617d01` (this PR). Each ran with an isolated state directory, a real WhatsApp account linked in self-chat mode, `openai/gpt-5.5` on the native Codex harness (bundled app-server 0.172.0), and `tools.openclaw.autoApproveChanges: false`. Both runs followed the same steps, and the chat text below was read from a separately linked device's message store: 1. Message 1 asks the agent to set `ui.assistant.name` through the `openclaw` tool. The tool posts the approval prompt and blocks while it waits. 2. During that wait, message 2 arrives (`what's 2+2?` before, `what's 3+3?` after) and is steered into the active run. 3. About 60 seconds later the Gateway logs `message dispatch completed ... outcome=error duration=60881ms reason=question-response-indeterminate` (60666 ms after the fix). 4. `/approve <id> deny` sent from the chat ends the wait, and the run finishes. Chat after the run ends: | | Before (`7760906`) | After (`1617d01`) | | --- | --- | --- | | Agent reply | `"PROOF-207150-B: also, what's 2+2?" 2+2 = 4. Config change was denied.` | `Denied. Meanwhile you said: "PROOF-207150-D: also, what's 3+3?" 3+3=6.` | | Steering outcome sent to the chat | `Codex accepted steering but did not confirm transcript consumption \| Codex steering transcript consumption confirmation timed out` | `OpenClaw could not confirm that input. It was not sent again; check the conversation before retrying.` | | Gateway log | no warning | `steering receipt unconfirmed; input kept without replay error="Codex accepted steering but did not confirm transcript consumption \| Codex steering transcript consumption confirmation timed out"` | On both builds the runtime consumed the steered message and the agent answered it inside the same run. Each Gateway log shows one run ID, with no followup turn, abort or replay. The pending tool call was not interrupted: it returned only when the approval was denied. The Control UI is not affected; it shows its own "send failed" text for this ack. 🤖 Generated with [Claude Code](https://claude.com/claude-code) ## Maintainer follow-up - Channel steering and Talk now read one `AGENT_INPUT_UNCONFIRMED_MESSAGE` from `src/talk/agent-run-control-shared.ts`, Talk's existing message owner. The second copy of the text is gone, and the wording is unchanged. - Gateway proof (qa-channel, real Codex app-server, approval wait, native `/steer`), before, after and control: openclaw#207150 (comment) Merge danger: two-way door. Only the reply text and one bounded diagnostic log line change, with no state or contract change. A revert fully undoes it. Co-authored-by: Ayaan Zaidi <[email protected]>
Closes #166744
What Problem This Solves
Fixes running tools being canceled by ordinary steering when the runtime retains the input but its receipt cannot be confirmed.
User Impact
Running work continues; OpenClaw reports receipt uncertainty without replaying the message. Explicit stop/interrupt and exact-owner adoption cancellation remain available. No configuration, migration, or backend receipt API changes.
Why This Change Was Made
The shared admission owner currently preserves exception-based uncertainty but turns equivalent result-based uncertainty into an accepted outcome that aborts the run. Normalize both to the existing non-replayable indeterminate state. Remove the automatic abort, the status-only exception, and unreachable Gateway abort reporting; retain explicit adoption cancellation.
The policy entered in #119594, with the incident's Gateway path introduced in #120285. The missing-tool-result diagnostic is unchanged: this fixes the producer-side cancellation, not the warning.
Evidence
Maintainer live proof (2026-10-08)
Real Gateway + real native Codex proof passed at
31570596c2cc83aa602cee19e3470761ac743ed4. Main2eed9ca52d633ca6d6da4bc38bd83154ff17f499reproduced the unwanted cancellation; the PR preserved the running command, surfaced uncertainty, and did not replay the input. Both runs used fresh isolated state, loopback ephemeral ports, and the same fresh Blacksmith Testboxtbx_01m4d7cyva99sygj9w0zxrjzkg(hydration workflow). The lease is stopped.A normal WebSocket
chat.sendstarted a native Python command blocked on a FIFO. After both the process marker and its nativecommandExecutionstart were observed, another ordinarychat.sendsteered the active run. A transparent stdio proxy forwarded the realturn/steer, observed its successful native acknowledgement, and withheld that acknowledgement and any corresponding early consumption receipt. The existing app-server request deadline producedtranscriptCommit: "unconfirmed". No provider, model, Gateway handler, registry, or app-server was mocked. Only receipt delivery was fault-injected. Hydrated credentials were used without printing their values.2eed9ca531570596final; retryokUNAVAILABLEabortedfinalafter FIFO releasefailed; FIFO work did not completecompleted; one matching start/completion IDPR diagnostic excerpt:
Codex accepted steering but did not confirm transcript consumption | turn/steer timed out | CODEX_APP_SERVER_LOCAL_REQUEST_CANCELLED. The PR command remained both OS-live and native-item-in-progress through that diagnostic. After release, it completed normally. The main run proves unwanted cancellation; it emitted a failed native completion, so this controlled run does not claim to reproduce the original missing-result symptom. Native event pairing was checked; persistent transcript storage was not independently audited. No replay was observed through run completion and an explicit same-key retry.All remote payloads ran through
$HOME/.local/bin/openclaw-testbox-envusingnode scripts/crabbox-wrapper.mjs run --id tbx_01m4d7cyva99sygj9w0zxrjzkg --label rel6-166754 --timing-json --shell. Source was verified against the pinned Git tree before execution. Main ran in a separate temporary worktree, removed afterward. The temporary harness driver SHA-256 was648896691e9fdb001e5eea64d49eb080e017303ce6cf887400be58f8dd2f8ab0; proxy SHA-256 wasb8ea3787b790966d293b8c2df7f235de4563ec8b7f035bf1d03fcefda627062a.Executed proof commands and checks
After materializing the temporary harness, the live payloads used the installed official Codex launcher:
Wrapper command durations, including remote preparation: PR 133.745 s; main 161.519 s. Gateway ports were 40631 and 33337, with distinct temporary state directories. The first proof setup attempts found fixture problems: absent fetched Git metadata after native sync, an obsolete readiness-log matcher, and the native process marker preceding its app-server start notification. Each was diagnosed before rerunning; none changed product source or counts as passing steering proof.
pnpm tsgo:core pnpm tsgo:core:test --ci-graphs-json '["core-test-messaging","core-test-gateway-methods"]' node scripts/run-vitest.mjs \ src/auto-reply/reply/reply-run-registry.test.ts \ src/auto-reply/reply/reply-run-registry.successor-barrier.test.ts \ src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts \ src/auto-reply/reply/reply-run-registry.visibility.test.ts \ src/auto-reply/reply/reply-run-registry.preparation.test.ts \ src/auto-reply/reply/reply-run-registry.abort.test.ts \ src/auto-reply/reply/reply-run-registry.backend-ready.test.ts \ src/auto-reply/reply/agent-runner-steer-adoption.question-recovery.test.ts \ src/auto-reply/reply/reply-run-registry.control-owner.test.ts \ src/auto-reply/reply/reply-run-registry.question-registration.test.ts \ src/auto-reply/reply/agent-runner-steer-adoption.worker.test.ts \ src/auto-reply/reply/reply-run-registry.retained-singleton.test.ts \ src/gateway/server-methods/chat.directive-tags.test.ts \ src/gateway/server-methods/chat-send-message-injection.test.ts \ src/gateway/server-methods/chat-send-message-injection.isolated-gateway.test.ts \ --maxWorkers=1584 tests passed across all 15 module files, including all 225 cases in
agent-runner.runreplyagent.e2e.test.ts. Command wall time: 574.45 s including cold E2E runtime preparation. Messaging test types passed in 63.6 s; Gateway-method test types passed in 61.1 s (125.05 s combined command wall). Core production types passed. No extension files changed.The production-only negative control kept the PR tests and replaced only
src/auto-reply/reply/reply-run-registry.message-injection.tswith its main2eed9ca5contents in a disposable worktree:node scripts/run-vitest.mjs src/auto-reply/reply/reply-run-registry.visibility.test.ts \ --maxWorkers=1 -t 'retains steering custody without canceling backing work after an uncertain'Expected red: uncertain-result case failed at line 500 (
acceptedreceived,indeterminateexpected), while equivalent exception-based uncertainty passed: 1 failed, 1 passed, 32 skipped; 21.10 s wall. The production bytes were restored and the disposable worktree removed. The unchanged PR passes both cases in the full module run.Changed-file
oxfmt --check, type-awareoxlint --deny-warnings, andgit diff --checkpassed. Local Vitest preparation could not resolve the nested checkout'squickjs-wasiworkspace dependency and collected no tests; the complete leased install supplied the passing proof above. No local dependency install was performed.Deslop found no material improvement to make. Independent Codex AutoReview completed scoped-clean through P2. No additive code commit, rebase, force-push, or merge was performed. Diff against merge base
905a74d1bad2b82198f2fb3161b807a71a008f19: production +14/-42 (net -28), tests +191/-62 (net +129), docs +3/-2 (net +1). The four production files have the same -28 delta against inspected current main.Fresh main
fc3e0973643225f56ac51c9bb8228d0d5df5c3a8has byte-identical affected production owners to the live-tested main baseline.git merge-tree --write-tree HEAD fc3e0973643225f56ac51c9bb8228d0d5df5c3a8completed without conflicts (treefcf64042fb46e1cc113203cdc1ca28250f8613de). Exact-head CI remains successful: 70 successful checks, 73 skipped, 1 neutral, no pending/failing checks. ClawSweeper revision 6 has no actionable findings. The fresh write-gating GitHub read reportsMERGEABLEat the unchanged PR head. No merge was performed.Earlier validation
--maxWorkers=1(189.78 s command wall time). Coverage includes the actual Gateway starter/finalizer composed with the shared registry, ordinary/status steering, channel custody after source cancellation, no replay, confirmed rejection, and explicit captured-owner cancellation without touching a successor.pnpm check:changed --base c6698b1e9b2 --timed: all planned formatting, lint, type, architecture, and integrity guards passed.git diff --checkpassed.The new Gateway receipt cases took 38 ms total locally; owner receipt/cancellation cases took 8 ms. Hosted CI seconds are not yet measured. No new sleeps, real timers, process boots, or serial configuration were added. Initial validation setup races were caused by concurrent artifact generation and source edits during preparation; the final candidate is frozen and artifact writers are serialized.
The earlier tests provided admission/cancellation boundary proof. The maintainer live comparison is recorded above. The retained incident logs still do not establish why the original native receipt became uncertain, and this change does not claim late-receipt recovery. No operator Gateway was modified.
CI Follow-up
The first CI run found one stale expectation in the existing Gateway successor regression: uncertain acceptance now produces an error receipt with its diagnostic, not an
okreceipt. Corrected that assertion without changing production behavior or the no-abort/no-replay/persistence checks. The original failure reproduces locally. All 127 tests in the Gateway file pass (42.96 s command wall time; 39.24 s Vitest wall time), and the compacted final setup passes the focused regression (37.56 s command wall time). Independent review found no P0/P1 issues. The original failing CI job ran for 286.7 s; this adds no new test case.Resolved hosted CI blocker and rebase
The failed cancellation fixture in CI run 37699363282 was diagnosed and fixed separately in #166807, merged as
eb7a4b157452f24c37a2a1c45e7f9a92341514bd. A controlled ordering reproduced the no-start assertion failure; the repair synchronizes the existing real session-preparation boundary without changing cancellation behavior or weakening assertions. All 45 cases passed locally on that repair.At the maintainer's request, this PR was rebased onto main
905a74d1bad2b82198f2fb3161b807a71a008f19, which contains that repair. Current head:31570596c2cc83aa602cee19e3470761ac743ed4.git range-diffconfirms both steering commits are patch-identical to the previously reviewed commits. Original proof remains prior-head evidence, not current-head hosted CI. Rebased proof: all 261 selected tests passed across five files (433.99 s wrapper wall time): Gateway 155, shared-owner/channel custody 61, and cancellation 45. This includes the formerly failing late-descendant fixture (3.930 s). Core and all 27 test typecheck graphs passed; changed-file lint and the remaining native-schema, storage, media, runtime-sidecar, import-cycle, webhook, and pairing guards passed. Exact-head CI run 37705812079 completed green. ClawSweeper revision 4 reviewed this exact head with no actionable findings. GitHub reports CLEAN and MERGEABLE.The local
check:changedaggregate is not green: its production/full-tree/script unused-export scans report two inherited findings,scripts/publish-model-catalog.mts: readRecommendedModelsandsrc/config/sessions/session-cold-storage-guard.types.ts: SessionColdTurnGuard. Both files are byte-identical to the pinned rebase main; this PR changes neither their declarations nor consumers. The remaining checks were run separately after the aggregate stopped, without skipping or suppressing the failed scan. No unrelated cleanup is included. The old run's cancelled coverage is not passing evidence.