Skip to content

fix(cli): preserve mid-turn text in durable replies - #115455

Merged
steipete merged 2 commits into
mainfrom
codex/fix-cli-durable-commentary
Jul 29, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/fix-cli-durable-commentary

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #110067
Related: #106760

What Problem This Solves

Fixes an issue where users of CLI-backed agents could lose substantive assistant text from durable channel replies when the model wrote that text before a tool call and ended the turn with a short final wrap-up.

Why This Change Was Made

Completed CLI commentary now enters the existing shared block-reply delivery owner. Block-streaming turns treat it as an ordinary answer block so the established coalescing and final-payload dedupe rules apply; channels that explicitly enable commentary payloads can receive the same text as durable commentary without enabling block streaming. The transient preamble-progress projection remains independent and can run alongside durable delivery.

This keeps the fix provider- and channel-neutral, adds no config surface, and avoids reconstructing full accumulated CLI output at the end of the turn.

User Impact

Long CLI-backed tool runs can preserve their substantive mid-turn narration instead of leaving operators with only a terse final sentence. Existing progress drafts continue to work as before.

Evidence

  • node scripts/run-vitest.mjs src/agents/cli-output.test.ts src/agents/cli-runner.spawn.test.ts src/auto-reply/reply/agent-runner-execution-cli-progress.test.ts src/auto-reply/reply/agent-runner-execution-cli-commentary.test.ts — 188 tests passed on the final head.
  • The new regression launches a real scripted stream-json CLI subprocess, exercises the production parser/lifecycle bridge, and verifies both the durable commentary block and distinct final answer.
  • OPENCLAW_HEAVY_CHECK_LOCK_SCOPE=worktree node scripts/check-changed.mjs — passed on Blacksmith Testbox tbx_01kynm9xp2ewcm0f6egaxt3r7v; typecheck, lint, formatting, dead-code, boundary, and repository guards all clean.
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main — clean; no accepted/actionable findings, confidence 0.91.

AI-assisted implementation; I reviewed the full delivery path and validation output.

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Jul 29, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@steipete
steipete merged commit b436055 into main Jul 29, 2026
125 of 127 checks passed
@steipete
steipete deleted the codex/fix-cli-durable-commentary branch July 29, 2026 01:02
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 29, 2026
* origin/main: (57 commits)
  docs: document gateway and memory chat wizards (#115487)
  fix(agents): restore subagent completion delivery on CLI runtimes (#115422)
  fix(sandbox): stop provisioning failures from exhausting fallbacks (#115481)
  refactor: remove duplicate runtime and plugin paths (#115483)
  fix(ui): canonicalize agent model identity (#115480)
  fix(ui): preview model picker interactions live (#115477)
  fix(ui): match disabled microphone picker background (#115472)
  refactor(code-mode): split focused runtime stress suites (#115462)
  fix(gateway): preserve restart intent across coalesced config writes (#110397)
  fix: scope subagent handoff to direct tools (#115466)
  docs: explain native subagent handoff
  fix: clarify native subagent completion handoff
  fix(config): respect agent directory filesystem case (#105402)
  refactor(code-mode): unify safe OpenAI tool filtering (#115460)
  refactor(code-mode): prepare MCP namespaces once per run (#115459)
  fix(ollama): preserve selected model capabilities during onboarding (#115467)
  refactor(chat): remove duplicate session projection paths (#115461)
  refactor(code-mode): make tool catalogs run-owned (#115458)
  fix(cli): preserve mid-turn text in durable replies (#115455)
  fix(memory): fall back to keyword search when embeddings cannot start (#115397)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 29, 2026
* fix(cli): deliver commentary as durable replies

* test(cli): cover durable commentary subprocess
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

claude-cli runtime: mid-turn assistant text is never delivered durably — block streaming is not wired for CLI backends

1 participant