codex exec resume --last rejects prompt when --json is set

Resolved 💬 1 comment Opened Nov 16, 2025 by dkhokhlov Closed Jan 27, 2026

What version of Codex is running?

0.58.0

What subscription do you have?

team

Which model were you using?

gpt-5 codex

What platform is your computer?

Linux 6.2.0-39-generic x86_64 x86_64

What issue are you seeing?

Running the exec CLI with both --json and resume --last fails whenever a prompt is provided after --last. Clap treats that positional as SESSION_ID, so it errors with “the argument '--last' cannot be used with '[SESSION_ID]'”.

Execution aborts immediately with error: the argument '--last' cannot be used with '[SESSION_ID]'.

What steps can reproduce the bug?

Run:
codex exec --json resume --last "2+2"

What is the expected behavior?

The command resumes the most recent session and sends "2+2" as the new prompt while still emitting JSON events.

Additional information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗