Bug: JSON output drops command_execution aggregated_output when only deltas are streamed

Resolved 💬 0 comments Opened Jan 29, 2026 by Kbediako Closed Feb 6, 2026

What Version Of Codex Is Running?

codex-cli 0.92.0

What Subscription Do You Have?

Pro

Which Model Were You Using?

GPT 5.2-Codex

What Platform Is Your Computer?

Mac Mini M4 - Darwin 25.3.0 arm64 arm

What Terminal Emulator And Version Are You Using (If Applicable)?

Apple_Terminal 466 (TERM_PROGRAM=Apple_Terminal), shell: /bin/zsh, TERM=xterm-256color

What Issue Are You Seeing?

In --json mode, command output can be dropped in the final JSONL command_execution item when output is emitted only via ExecCommandOutputDelta events and ExecCommandEnd.aggregated_output is empty. Downstream JSON consumers see an empty aggregated_output even though output deltas were streamed.

What Steps Can Reproduce The Bug?

  1. Run Codex CLI with --json so JSONL events are emitted.
  2. Trigger a command execution where output arrives as ExecCommandOutputDelta events but ExecCommandEnd.aggregated_output is empty (this happens in some backends that only stream deltas).
  3. Observe the final command_execution item: aggregated_output is empty despite earlier delta output.

Example generator:
Not available (requires a backend that emits ExecCommandOutputDelta events but leaves ExecCommandEnd.aggregated_output empty).

What Is The Expected Behavior?

The final JSONL command_execution item should include the concatenated delta output as a fallback when ExecCommandEnd.aggregated_output is empty, so JSON output preserves command output.

Additional Information

  • Impacted component: codex-rs/exec JSON output event processor.
  • Proposed fix: buffer stdout/stderr delta bytes separately (cap at 1 MiB per stream) and aggregate with the same stderr-biased cap as core when ExecCommandEnd.aggregated_output is empty.
  • Manual repro (CLI-level): use a backend that emits deltas but leaves ExecCommandEnd.aggregated_output empty; run codex exec --json, execute any command with output, and compare final aggregated_output to streamed deltas.

View original on GitHub ↗