Skip to content

[Feature]: claude-cli live-session — stream thinking deltas + incremental assistant text to channel preview (parity with Codex progress streaming) #97526

Description

@shadow-enthusiast

Summary

The claude-cli live-session runtime and the Codex app-server runtime give very different live UX for the same kind of turn, on the same message-based channel preview:

  • Codex app-server: reasoning and tool/command activity stream into a live progress preview in real time; on turn/completed the draft is cleared and the final answer is delivered.
  • claude-cli live-session: a single reasoning bubble appears, is immediately removed, then a long silent gap during generation, then the final answer arrives in one piece.

Root cause (source-level)

In the Claude stream-json parser (claude-live-session-*.js, parseClaudeCliStreamingDelta), only:

  • content_block_deltatext_delta (assistant text), and
  • tool_use start/result events

are forwarded. There is no thinking_delta path — extended-thinking content blocks are not streamed incrementally, so reasoning surfaces as a single block (shown as one transient /reasoning stream preview that is deleted after final delivery, per docs/concepts/streaming.md). And during answer synthesis the channel preview isn't driven incrementally, so it reads as "reasoning blip → silence → final."

By contrast, the Codex harness emits a rich progress event stream (raw reasoning, reasoning progress, agentMessage progress, tool/command lifecycle), which OpenClaw renders as a continuously-updating progress preview.

The data is already available

The bundled claude-cli backend launches with --output-format stream-json --include-partial-messages, so Claude already emits content_block_delta events including thinking_delta and incremental text_delta. The parser just doesn't consume the thinking deltas (and doesn't appear to drive an incremental preview from text deltas) the way the Codex runtime does.

Proposed

  1. Parse content_block_delta where delta.type === "thinking_delta" and forward it as a reasoning-preview delta (respecting /reasoning mode: stream → transient preview, etc.).
  2. Drive the incremental answer preview from text_delta so edit-capable channels (Telegram/Discord) get a continuously-updating draft during generation.

Net effect: live reasoning/answer progress for claude-cli at parity with the Codex progress streaming experience. This is purely a matter of feeding OpenClaw's existing message-based preview with deltas Claude already sends — no token-delta channel transport required.

Repro

  1. Provider anthropic/* with model-scoped agentRuntime.id: claude-cli, live-session enabled, /reasoning stream.
  2. Send a prompt that triggers extended thinking.
  3. Observe: one reasoning bubble → removed → silence → final. Compare to a Codex-runtime model (live tool/reasoning progress).

Related

Same claude-cli live-session integration area as #97489 (auth-gate doesn't recognize apiKeyHelper) and the picker-visibility contract #83342.

Environment: OpenClaw 2026.6.10.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions