← NEWS DESK
release impact

OpenClaw Hardens Interrupted Agent Turns, Streams and Recovery on Main

A P1 Codex repair and four related fixes stop incomplete turns looking successful, destructive steer retries, truncated exec recovery and unsafe terminal tool calls.

Independent reporting and tested guidance for OpenClaw operators · Editorial standards

OpenClaw has merged a P1 repair for Codex/OpenAI inference turns that could be interrupted or incomplete yet still appear successful. The change also tightens stream framing, cancellation ownership and final delivery. Four adjacent merges close related gaps in session steering, approved command recovery and streamed tool-call terminals.

These are source changes on main, not evidence that a particular packaged release contains them. Operators should identify a containing revision and test interruption deliberately before treating the failure modes as fixed.

What changed

Boundary Previous failure Correct result
Codex inference completion An interrupted or incomplete turn could be reported as successful; streamed response or transcript content could be lost Only the authoritative terminal lifecycle completes the turn, with source delivery preserved
Stream framing Open CR-delimited response frames could remain undispatched Valid complete frames are emitted without waiting for the wrong delimiter condition
sessions.steer retry Replaying an idempotency key could interrupt the active run and clear queued follow-up work before admission decided it was a replay Interruption occurs only for a newly admitted steer turn
Approved async exec recovery A resumed agent could receive only the last 400 collapsed characters of command output Recovery preserves whitespace and supplies a bounded 16,000 UTF-16-unit continuation
Malformed or incomplete model streams Internal parser text or provisional Mistral tool fragments could escape as user content or executable calls Malformed frames fail safely; only terminally complete tool calls become actionable

The shared theme is authority. A partial frame, a cached retry, a background notification and a provisional tool delta are observations—not proof that the turn completed or owns the next side effect.

Codex completion now follows the turn lifecycle

PR #116012 is the central change. The official merge record says it addresses interrupted or incomplete inference reported as success, lost streamed responses or audio transcripts, and cancellation that could target a different shared owner. The landed commit also records handling for open CR-delimited frames, interrupted-turn completion and a canonical source-delivery contract.

That is operationally significant because false success is harder to detect than an explicit error. A caller may persist an incomplete answer, advance an automation, or assume a tool result was delivered when the model turn never reached an authoritative terminal state.

Interpretation: transport closure is not completion. The runtime must reconcile provider terminal state, cancellation ownership and delivery before it labels a turn successful.

A retry must not become a new interrupt

PR #116969 fixes sessions.steer ordering. Previously, steering could interrupt current work and clear queued follow-ups before chat.send checked whether the supplied idempotency key represented new work or a replay. A routine client retry could therefore abort the turn it was trying to recover—or unrelated work that started later.

The merged path gates interruption on new admission and serializes steer admission retries. Operators using unreliable networks, browser reconnects or custom API clients should test duplicate delivery of the same key while another turn is active. The replay should return the prior outcome without changing current session ownership.

Approved exec recovery keeps useful evidence

PR #117177 covers an agent resuming after an approved asynchronous command. The old continuation reused a compact notification formatter: it collapsed whitespace, discarded the head and retained only the last 400 characters. That can turn structured command output into misleading evidence, especially for tables, stack traces, test summaries and diffs.

The shared recovery formatter now preserves whitespace and bounds the continuation at 16,000 UTF-16 units. The bound still means very large output can be incomplete. Consequential workflows should write durable artifacts or query structured state rather than treating resumed prompt context as the only record.

Do not “verify” this with secrets in command output. Use a synthetic fixture containing distinct head and tail markers, indentation and more than 400 characters.

Stream fragments are not executable facts

PR #116966 prevents malformed Codex frames from surfacing internal parser text. PR #117137 suppresses incomplete and unsafe Mistral streamed tool calls. Together they reinforce the same rule already emerging across OpenClaw’s OpenAI adapters: provisional deltas may inform display, but terminal provider state controls execution.

For any tool with side effects, an interrupted stream must execute zero incomplete calls. A completed stream should execute each terminal call once, in order. Raw parser diagnostics should remain in bounded operator diagnostics, not be presented as assistant content.

Acceptance run

Use a disposable session and harmless tools:

  1. stream a normal Codex response containing several chunks and verify the final text appears once;
  2. interrupt before terminal completion and confirm the turn is not reported as successful;
  3. exercise CR-delimited frames through the supported test harness;
  4. replay one sessions.steer idempotency key while unrelated work is active and prove neither run is interrupted;
  5. approve an async command that emits structured synthetic output, restart at the continuation boundary and verify preserved head, tail and whitespace within the documented bound;
  6. terminate a Mistral tool stream mid-arguments and prove no tool executes; and
  7. inject a malformed non-sensitive frame through a fixture and confirm parser internals do not reach user-visible output.

Record the exact Gateway, provider adapter and model versions. A passing clean turn does not exercise any of these boundaries.

Evidence and limits

The official merged PR and commit records supplied by the OpenClaw repository collector establish the failures, chronology and reported corrections. Direct GitHub page extraction and independent web search were unavailable during this run, so implementation and test claims remain attributed to upstream.

OpenClaw Academy did not interrupt a live Codex provider turn or execute a consequential tool. The evidence proves merged source changes, not package inclusion or universal correctness across third-party clients.

Bottom line

An agent turn is complete only when its terminal owner says so, and a retry is harmless only when idempotency is checked before interruption. OpenClaw main now applies that rule more consistently to Codex streams, steer retries, approved command recovery and Mistral tool calls.

Adopt a confirmed containing build through staging, then test interruption, replay and resume—not just the happy path.

THE RECEIPTS

Claims should survive the click.

Primary links used for this article are listed openly. If the evidence changes, the verification date changes with it.
  1. 01Harden Codex streaming, cancellation and live QA — PR #116012
  2. 02Preserve approved command output when sessions resume — PR #117177
  3. 03Make sessions.steer idempotent retries non-destructive — PR #116969
  4. 04Prevent malformed Codex frames exposing parser text — PR #116966
  5. 05Suppress incomplete Mistral streamed tool calls — PR #117137

THE OPERATOR BRIEF

One useful email when the signal earns it.

Release impact, security changes and repository intelligence. No daily sludge.