Skip to content

Resume hides prior tool calls in the TUI transcript #4790

@kdhira

Description

@kdhira

What version of Codex is running?

codex-cli 0.44.0

Which model were you using?

gpt-5-codex

What platform is your computer?

Darwin 24.6.0 arm64 arm

What steps can reproduce the bug?

  1. Launch a new session from a project directory with codex -a on-request.
  2. Ask the agent to run a simple shell command (e.g. “List the repo root with ls. ”) and approve the resulting exec request. Verify the transcript shows the tool call and command output.
  3. Exit the TUI (Ctrl+C or /quit).
  4. Resume the session with codex resume --last.
  5. Inspect the rebuilt transcript: only user/assistant text is replayed.

What is the expected behavior?

The resumed transcript should include the same tool-call history (exec, apply_patch, MCP, etc.) that was visible before quitting so operators can audit what already ran.

What do you see instead?

Only EventMsg content is replayed, so tool calls and their outputs disappear from the TUI after resume. The operator loses all visible evidence of previous automation even though the backend kept the context.

Additional information

  • SessionConfiguredEvent.initial_messages is built from InitialHistory::get_event_msgs, which filters out RolloutItem::ResponseItem entries, so function/exec records never reach the TUI on resume.
  • Relevant code: codex-rs/core/src/codex.rs:514, codex-rs/protocol/src/protocol.rs:896, codex-rs/tui/src/chatwidget.rs:1343.
  • Rationale: without those entries the operator can’t audit prior automation, increasing the risk of duplicate or unsafe approvals because they no longer know what already ran.
  • Concern: security reviews or incident response become harder—the persisted rollout has the data, but resumptions hide it from the human in the loop who must make approval decisions.

(Code references with rust-v0.44.0 tag checked out)

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displaybugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions