Feature request: add `--diff-verbosity` to `codex exec` (default: `step`)

Resolved 💬 2 comments Opened Feb 5, 2026 by Henry-Jessie Closed Mar 20, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What variant of Codex are you using?

GPT 5.2(xhigh) in CLI

What feature would you like to see?

Add a control flag for stderr diff volume: -diff-verbosity to codex exec (default: step)

Pain point in codex exec runs

In codex exec scenarios, stderr is the primary stream for tracking progress, especially thinking block and exec log. However, once the agent starts editing files, progress signals are often buried by repeated large diff output, making it difficult to locate the valuable log.

A typical log pattern looks like this:

```text
thinking blcok
...

file update:
diff --git a/src/parser.rs b/src/parser.rs
@@ ...

  • old line A
  • new line A

... hundreds lines(sometimes even thousands) of diff

another thinking block or exec log

  In long runs, this makes it hard to quickly read:

  - current execution progress
  - tool state transitions
  - warnings/errors
  - turn boundaries
  
 ## Likely cause 
  From observed behavior, duplication appears to come from multiple event paths emitting diff data:
  1. Patch begin emits step-level changes (`PatchApplyBegin`), which output prints as full file/hunk content.
  2. Patch end emits `PatchApplyEnd`, then also emits `TurnDiff`.
  3. `TurnDiff` is generated from a turn-scoped tracker that returns cumulative diff state, not just per-step delta, so unchanged hunks reappear.
  4. At turn completion, another `TurnDiff` can be emitted for the same turn.
  5. Stderr rendering prints both step-level patch diff and turn-level cumulative diff, so the same hunks are shown multiple times.

 ## Feature request

  Add one control for stderr diff volume:

  --diff-verbosity {none|step|full}

  - none: suppress diff hunks in stderr
  - step: emit only current-step file-change diff 
  - full: keep current behavior (including cumulative turn-level diff output)

 ## Default recommendation
  Use `step` as the default for codex exec. (just as the behavior of interactive mode). This keeps file-change visibility while preserving log readability and progress tracking.

  ## Compatibility
  - Users who rely on current behavior can opt into `--diff-verbosity full`.
  - `--json` output remains unchanged for machine-readable integrations.
## Related issue and why this is separate

  Related: #6511

  I’m opening this separately because #6511 is scoped/triaged as a bug report, while this request
  is a product-level logging control and default-behavior proposal.
  Even if duplication is reduced, users still need explicit verbosity control for different
  operational contexts (CI readability vs full audit logs).

### Additional information

_No response_

View original on GitHub ↗

2 Comments

jonbelay · 6 months ago

Thanks for flagging this. To help us reproduce and prioritize:

  1. What environment are you using (OS, version, and install method)?
  2. What exact command or config triggers the issue?
  3. Can you share logs or error output if available?

We will update the proposal once we have the missing details.

etraut-openai contributor · 5 months ago

This feature request hasn't received enough upvotes, so closing.