Skip to content

Reasoning summaries not permanently displayed in CLI TUI during live streaming (on_agent_reasoning_final never called) #36499

Description

@itzrnvr

Problem

Reasoning summary deltas are correctly received, processed through the event pipeline, and forwarded to the TUI. However, they are never permanently displayed in the conversation history during live streaming sessions. They only appear as a transient status header while the model is thinking, then are silently discarded.

Evidence

— the function that moves accumulated reasoning from into a permanent — is only called in replay mode:

  • — ✅ called during replay
  • — definition only

It is never called during live turns. in finalizes messages, plans, unified exec, and metrics — but does not finalize reasoning.

The reasoning buffer is then silently cleared at the start of the next turn:

Impact

  • Reasoning summaries from any provider (OpenAI, custom providers via model catalog) are accumulated during the turn but never persisted to history
  • Users cannot review the model's reasoning after the turn completes
  • Subsequent turns don't include previous reasoning in context (since it was never saved)

Suggested fix

Add in before any buffer cleanup:

Environment

  • Codex CLI v0.146.0
  • Observed on Windows with both built-in OpenAI models and custom providers (DeepSeek via Responses API)
  • Token counts confirm reasoning content IS received (output tokens increase proportionally)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLITUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displaybugSomething isn't workingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions