Include session start timestamp in codex exec --json stream

Resolved 💬 3 comments Opened Dec 30, 2025 by hubix2000 Closed Feb 23, 2026

Feature request

When consuming codex exec --json, there is no session creation timestamp in the JSONL stream. If a client cannot process the full stream (or processes it asynchronously), it is hard to later reconcile and synchronize sessions by time across the JSONL rollout files. I need a stable session timestamp so I can query “changes since X” reliably.

Proposed behavior

Emit the session start timestamp (RFC3339, UTC) in the JSON stream as part of the initial thread.started event. Ideally this is the same “locked” timestamp written into the rollout file’s SessionMeta.timestamp and remains stable across resumes.

Example (new field):

{"type":"thread.started","thread_id":"<uuid>","timestamp":"2025-09-05T16:53:11.850Z"}

Rationale

  • Enables offline/partial stream processing and later synchronization.
  • Allows clients to correlate the exec stream with stored JSONL sessions using the canonical session timestamp.
  • Avoids relying on event arrival time, which is not stable across resumptions.

Notes

  • For resumed sessions, the timestamp should come from the existing rollout SessionMeta (not a new clock value).
  • The format can match the existing rollout SessionMeta.timestamp RFC3339 format.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗