Skip to content

codex exec truncates command output #5095

@imownbey

Description

@imownbey

What version of Codex is running?

0.46.0

Which model were you using?

gpt-5-codex

What platform is your computer?

Darwin 24.3.0 arm64 arm

What steps can reproduce the bug?

imownbey@mac monorepo % codex exec "cat longfile"
OpenAI Codex v0.46.0 (research preview)
--------
workdir: /Users/imownbey/code/monorepo
model: gpt-5-codex
provider: openai
approval: never
sandbox: read-only
reasoning effort: none
reasoning summaries: auto
session id: 0199d501-48af-7a31-a8f0-a472fb6a7278
--------
**Preparing to run shell command**
exec
bash -lc 'cat longfile' in /Users/imownbey/code/monorepo succeeded in 14ms:
eaoiwjf idj fads
fdsf
a
fd
agdsgsadgdag
dfadsg
dgsgfdafd
agds
afdf

dsa
fa
dsg
sadg
dsah
codex
File `longfile` content shown above. No changes made.
tokens used
3,954
File `longfile` content shown above. No changes made.
imownbey@mac monorepo % codex
╭───────────────────────────────────────────╮
│ >_ OpenAI Codex (v0.46.0)                 │
│                                           │
│ model:     gpt-5-codex   /model to change │
│ directory: ~/code/monorepo                │
╰───────────────────────────────────────────╯

  To get started, describe a task or try one of these commands:

  /init - create an AGENTS.md file with instructions for Codex
  /status - show current session configuration
  /approvals - choose what Codex can do without approval
  /model - choose what model and reasoning effort to use
  /review - review any changes and find issues


› cat longfile


• Explored
  └ Read longfile

─ Worked for 5s ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

• cat longfile outputs:

  eaoiwjf idj fads
  fdsf
  a
  fd
  agdsgsadgdag
  dfadsg
  dgsgfdafd
  agds
  afdf

  dsa
  dg
  adsg
  fa
  dsg
  sadg
  dsah

  fa
  sfd
  a
  fdsf
  ads
  fd
  asgds
  s
  ha
  hr
  a
  rtr
  t
  rwatewrew
Token usage: total=1,751 input=1,538 (+ 13,824 cached) output=213 (reasoning 64)
To continue this session, run codex resume 0199d501-6b5e-71b2-ae5d-1947c5ff465e
imownbey@mac monorepo %

What is the expected behavior?

I would expect both outputs to be the same

What do you see instead?

The codex exec one gets truncated making using codex exec useless whenever interaction with long command output is necessary

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions