Desktop/app-server history replay omits persisted commandExecution items

Open 💬 2 comments Opened Jun 14, 2026 by VincentAdamNemessisX

Summary

Codex Desktop/app-server history replay appears to omit persisted command execution items after a session is reloaded. The raw rollout JSONL still contains the command tool calls and outputs, but thread/read with includeTurns: true returns no commandExecution items for the same thread.

Environment

  • Codex CLI: codex-cli 0.133.0
  • Codex Desktop / app-server protocol: thread/read with includeTurns: true
  • Platform: macOS

Evidence

  • Raw rollout JSONL contains persisted command execution data, including response_item payloads with type: "function_call" and name: "exec_command", matching function_call_output payloads, and in some sessions event_msg payloads with type: "exec_command_end".
  • Across a local rollout corpus, the raw files include 47,534 exec_command function calls, 56,291 function call outputs, and 5,603 exec_command_end events.
  • For one sampled thread, raw JSONL contained thousands of tool/function rows. The SQLite thread index pointed to the correct rollout path. However thread/read includeTurns=true returned 130 turns with item counts such as fileChange: 250, mcpToolCall: 53, agentMessage: 757, and commandExecution: 0.
  • Additional sampled sessions with only legacy response_item.function_call(name=exec_command) rows and sessions with newer event_msg.exec_command_end rows also replayed with commandExecution: 0.
  • This makes command execution details disappear from the Desktop UI after reload/switch even though the underlying rollout JSONL is still intact.

Expected behavior

History replay should reconstruct command execution UI items, or an equivalent expandable tool-call item, from persisted rollout rows such as:

{"type":"response_item","payload":{"type":"function_call","name":"exec_command","call_id":"...","arguments":"{...}"}}
{"type":"response_item","payload":{"type":"function_call_output","call_id":"...","output":"..."}}
{"type":"event_msg","payload":{"type":"exec_command_end","call_id":"...","command":["/bin/zsh","-lc","..."],"cwd":"...","exit_code":0,"status":"completed"}}

Actual behavior

After reload/history replay, command execution details are missing from the returned thread items and from the Desktop UI. Other history items such as assistant messages, file changes, and some MCP/tool items can still appear.

Reproduction outline

  1. Create or identify a Codex session that has shell command executions.
  2. Confirm the raw rollout JSONL contains exec_command function calls and matching outputs, and/or exec_command_end events.
  3. Start app-server and call thread/read with includeTurns: true for that thread.
  4. Count returned turn items. The raw rollout has command execution data, but the replayed turns contain zero commandExecution items.

Notes

  • This report intentionally avoids including local paths, credentials, command output, or private session content.
  • The problem looks like a history replay/normalization issue rather than physical JSONL loss: the raw rollout files remain intact and the SQLite threads.rollout_path values point to the correct files.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗