Skip to content

fix: stop sending internal steering errors to the chat - #207150

Merged
obviyus merged 2 commits into
openclaw:mainfrom
brandon-julio-t:fix/codex-steering-timeout-chat-207117
Nov 29, 2026
Merged

obviyus merged 2 commits into
openclaw:mainfrom
brandon-julio-t:fix/codex-steering-timeout-chat-207117

Conversation

@brandon-julio-t

@brandon-julio-t brandon-julio-t commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

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

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: fix: stop sending internal steering errors to the chat #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.

When a run is stuck in a long tool call, such as a Codex run waiting up
to 10 minutes for an OpenClaw change approval, each message sent
meanwhile is steered into the run. Codex reads it only after the tool
call returns, so the receipt times out after 60 seconds. The chat then
got the runtime's internal error once per message, for example "Codex
accepted steering but did not confirm transcript consumption | Codex
steering transcript consumption confirmation timed out".

Channel steering delivered the indeterminate outcome's errorMessage as
the reply. That field holds whatever the runtime reported. Deliver the
plain notice Talk already uses for this state instead, and log the
runtime error as a diagnostic warning. Custody is unchanged: no replay,
no interrupt.

Each message still gets its own notice. Collapsing them per run needs a
dispatcher change and is left for a follow-up.

Evidence: the unconfirmed and backend-error cases in
agent-runner-steer-adoption.question-recovery.test.ts fail on main with
the raw text and pass with this change. Three other tests that asserted
the raw passthrough now assert the notice.

Related: openclaw#207117
@clawsweeper

clawsweeper Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:message-loss Channel message delivery can be lost, duplicated, or misrouted. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. clawsweeper:intake:bug Preliminary submission classification; full source review pending. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 28, 2026
@clawsweeper

clawsweeper Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

Replaces raw steering confirmation errors with a plain chat notice and records the diagnostic in Gateway logs.

Example: A WhatsApp user sends “what's 3+3?” while a Codex tool waits for approval, and steering confirmation times out.

  • Before: Chat receives “Codex accepted steering but did not confirm transcript consumption | Codex steering transcript consumption confirmation timed out”.
  • After: Chat receives “OpenClaw could not confirm that input. It was not sent again; check the conversation before retrying.”

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A minimal, correct repair with supplied channel proof; overall C reflects the intentionally partial linked-issue scope.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The added proof exercises runActiveReplySteer through source-built isolated Gateways and real WhatsApp/Codex on parent 2777a47 and head 1617d01: a message sent during approval waiting times out, receives the plain notice after the fix, and is later answered within the same uninterrupted run without replay, satisfying the previous review’s proof request.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: People receive internal runtime timeout diagnostics for messages that the active agent can later consume.
Reason: The change removes confusing diagnostic text at the shared channel boundary while retaining the established visible-uncertainty contract and honestly leaving deduplication open.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this PR provides a focused fix for internal steering diagnostics reaching chat, while leaving repeated notices tracked by the linked issue.

Reviewed head: 1617d0140be5257eccf1a0b58262e9e81a2c162a

Before merge

  • Await maintainer action - Authorize the held GitHub Actions runs for this head so required CI can execute and establish merge readiness.

Findings

None.

Agent review details

How this fits together

Channel messages enter the active reply runner, which injects them through the session controller into the runtime and converts uncertain consumption outcomes into channel replies.

flowchart LR
  A[Channel message] --> B[Active reply runner]
  B --> C[Session controller]
  C --> D[Runtime steering]
  D --> E[Uncertain receipt]
  E --> F[Plain chat notice]
  E --> G[Gateway diagnostic log]
Loading

Technical review

Best possible solution:

Keep the notice at the shared reply presentation boundary while preserving input custody and tracking notice deduplication in the linked issue.

Do we have a high-confidence way to reproduce the issue?

Current-main source passes the runtime diagnostic directly into the channel reply, and the author supplies a matching parent/head WhatsApp reproduction; this read-only review ran no target code.

Is this the best way to solve the issue?

This is the smallest focused repair for raw diagnostic delivery: it uses the existing presentation owner and preserves the deliberate uncertainty notice, without changing runtime receipt or replay behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ba0a7a5fac3e.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit e3ce08c adds src/auto-reply/reply/agent-runner-steer-adoption.ts:190 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e3ce08cd5ec1; files: src/auto-reply/reply/agent-runner-steer-adoption.ts)
  • Dallin Romney: Raw commit 78ade2d adds src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts:1377 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 78ade2d7253f; files: src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts)
  • Josh Avant: Raw commit f04709b adds src/auto-reply/reply/agent-runner-steer-adoption.ts:292 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: f04709b78a04; files: src/auto-reply/reply/agent-runner-steer-adoption.ts)

PR surface

Source +4, Tests +9. Total +13 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 5 1 +4
Tests 3 13 4 +9
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 18 5 +13

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: ⏳ waiting on maintainer.

Label justifications:

  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-28T02:56:30.703Z sha 1617d01 :: needs real behavior proof before merge. :: none

Reviewed November 28, 2026, 10:59 PM ET / November 29, 2026, 03:59 UTC (Revision 2).

@brandon-julio-t

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Added live WhatsApp before/after proof on a real Codex runtime to the PR body: the blocking approval wait, the steering receipt timeout, the plain notice on this head versus the raw error on the parent, and the runtime still consuming the steered message without replay.

@clawsweeper

clawsweeper Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Nov 29, 2026
- Channel steering and Talk now read one AGENT_INPUT_UNCONFIRMED_MESSAGE from talk/agent-run-control-shared.ts instead of two copies of the same text.
@obviyus

obviyus commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator

Gateway proof on the built candidate (secretless Docker, qa-channel DM, real bundled Codex app-server 0.172.0 against the QA mock provider). The openclaw tool posts an OpenClaw change approval and blocks; during the wait the person sends /steer STEER-207150-MARK also, what is 2+2?.

main  2777a471696e  approval held 75 s
  [diagnostic] message dispatch completed ... outcome=error duration=60661ms reason=question-response-indeterminate
  sender got: Codex accepted steering but did not confirm transcript consumption | Codex steering transcript consumption confirmation timed out

fix   493520e86447  approval held 75 s
  [diagnostic] steering receipt unconfirmed; input kept without replay error="Codex accepted steering but did not confirm transcript consumption | Codex steering transcript consumption confirmation timed out"
  [diagnostic] message dispatch completed ... outcome=error duration=60676ms reason=question-response-indeterminate
  sender got: OpenClaw could not confirm that input. It was not sent again; check the conversation before retrying.

control  493520e86447  approval after 10 s (receipt confirmed before the timeout)
  [diagnostic] message dispatch completed ... outcome=completed duration=10351ms reason=active_run_injected
  no error or notice; the run read the steered input and continued from it

Limit: qa-channel treats the indeterminate dispatch as fatal and the suite stops the Gateway about 61 s in, so this harness can't show the runtime reading the unconfirmed input after the tool returns. The PR doesn't change custody. The unit test covers it, and so does the reporter's WhatsApp run, where Codex read every steered message.

@obviyus

obviyus commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

Maintainer override: not needed. checks-node-changed-compact-large-31-1 passed when the failed jobs in run 46229045697 were rerun, so it was a flake, and ci-gate is green on 493520e.

@obviyus
obviyus merged commit 95fada2 into openclaw:main Nov 29, 2026
206 of 208 checks passed
@obviyus

obviyus commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator

Landed in 95fada2. Thanks @brandon-julio-t for the report and the fix. When a message is steered into a run that is stuck in a long tool call and its receipt times out, the chat now gets OpenClaw's existing notice ("OpenClaw could not confirm that input. It was not sent again; check the conversation before retrying.") instead of the runtime's internal error, and the raw error goes to the Gateway log. Talk and steering now share one copy of that text. #207117 stays open for sending at most one notice per run.

vincentkoc added a commit that referenced this pull request Nov 29, 2026
* commit 'ea8cd30a48de1f42962bb95535d2e1b3b201fc36': (599 commits)
  fix(ui): show a subtle placeholder while a new chat gets its title (#207809)
  fix: remove dismissed chat suggestions without waiting (#207792)
  test(gateway): isolate publication recovery memory pressure (#207993)
  fix(workboard): let users delete an empty default board (#207909)
  fix(ui): remove Open PR from the session menu (#207808)
  feat(ui): offer Add to Home agent when Home sidebar is open (#207773)
  fix(ui): keep narrow desktop composers on desktop icon and control sizes (#207772)
  fix: remove extra space on the right of the compact iPad chat bar (#207763)
  fix: keep the task progress options button inside the Details header (#207940)
  fix(workboard): update the active list when you archive or restore a card (#207790)
  fix: move dropped sessions into their Workboard column immediately (#207787)
  fix(whatsapp): retain sender for explicit current-message reactions (#190121)
  fix: return the agent ID when agents add finishes offline (#207926)
  fix: stop sending internal steering errors to the chat (#207150)
  fix(agents): scheduled runs fail after a read or fetch error the model recovered from (#180922)
  fix: confirm recovered config edits while the Gateway is busy (#207918)
  fix: make desktop chat presence avatars slightly smaller (#207966)
  fix: list and select routed Claude models without requiring Claude CLI (#207806)
  fix(ci): check out verifier before plugin preflight reuse
  test(reply): prove channel replacement on user messages (#207813)
  ...
@brandon-julio-t
brandon-julio-t deleted the fix/codex-steering-timeout-chat-207117 branch November 29, 2026 07:46
tideclaw-bot pushed a commit that referenced this pull request Nov 29, 2026
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]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 30, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:message-loss Channel message delivery can be lost, duplicated, or misrouted. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants