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
rollout file not written until first API turn completes, no way to get thread_id at spawn time for embedding tools #18690
External tools that spawn Codex sessions (e.g., task runners, mission managers) need to correlate their own session identifiers with Codex thread IDs at spawn time.
Currently the rollout file under ~/.codex/sessions/ is not written until the first API turn completes (~15–30s after startup). There is no earlier signal available to the host process.
Reproduction (exec mode)
# thread.started appears immediately in stdout — thread_id is here
codex exec --json "hello"&# but the rollout file does NOT appear until ~16s later (after API responds)
ls ~/.codex/sessions/$(date +%Y/%m/%d)/
What we tried
Kill before first turn → no rollout file, session not resumable
/status slash command → local only, does not trigger file write
Watch ~/.codex/sessions/ → file appears only after first API response
Requested
Either of:
Write session_meta to rollout file at session init (before first API call)
Activity
github-actions commentedon Apr 20, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
etraut-openai commentedon Apr 20, 2026
This behavior is by design, not a bug. You need to complete the first turn before the rollout file is written.