You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No way to resume in non-interactive mode when session id is not outputted #3817
codex exec --json "<my message>" does not return a session id, and therefore I cannot then perform codex exec --json resume <session_id> "<my followup message"
using codex proto seems to have the opposite problem, it returns a session id but is not capable of resuming with it.
My workaround for now if getting the latest session id from the ~/.codex/sessions directory, but my application lets you run multiple prompts in rapid succession so this is not reliable.
Reacted by Louis Arge, Santtu Keskinen, Lachlan Donald, Martin Lukasik, michprev, Alvin Gyumin Choi, Daniel Imfeld, Ryosuke Tani, JasonS, Varun Ursekar and 1 more
Hi, can you please try codex exec --experimental-json (will soon become the default --json behavior) that returns thread_id in combination with codex exec resume <thread_id>?
@pakrym-oai This kind of works, however, cli flags and arguments from the first invocation aren't preserved in subsequent ones - in the screenshot below you can see that when we resume, it no longer outputs JSON. Maybe for JSON this isn't so bad, but there are other arguments (e.g. skip-git-repo-check) that preclude this workaround.
The current command line parsing logic is a bit deficient and requires arguments to go between codex exec and resume
try codex exec --experimental-json <other args> resume ... .
Activity
MaurUppi commentedon Sep 18, 2025
#3712
skeskinen commentedon Sep 20, 2025
Facing the same issue with vibe-kanban.
codex-cli 0.38.0 & codex-cli 0.39.0
eadlam commentedon Sep 28, 2025
You can use --last with exec.
pakrym-oai commentedon Oct 1, 2025
Hi, can you please try
codex exec --experimental-json(will soon become the default--jsonbehavior) that returns thread_id in combination withcodex exec resume <thread_id>?varunursekar commentedon Oct 1, 2025
@pakrym-oai This kind of works, however, cli flags and arguments from the first invocation aren't preserved in subsequent ones - in the screenshot below you can see that when we resume, it no longer outputs JSON. Maybe for JSON this isn't so bad, but there are other arguments (e.g.
skip-git-repo-check) that preclude this workaround.pakrym-oai commentedon Oct 1, 2025
The current command line parsing logic is a bit deficient and requires arguments to go between
codex execandresumetry
codex exec --experimental-json <other args> resume ....We are aware and working on this.
docs(steering): a pinned session id rots silently — the prior art, an…