Provide a content-free session attestation channel: rollout path and/or caller-supplied thread id
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
Use case
We orchestrate fleets of coding-agent workers (one task per process) and meter
per-task token usage by reading each worker's own session file. Today Claude
and Pi both let the running session attest its own file at session start
(Claude: SessionStart hook carries transcript_path + session_id;
Pi: extension API getSessionFile() / getSessionId()), plus a
caller-supplied session pin (claude --session-id <uuid>,
pi --session-id <uuid>). Our observer then verifies the claim against the
file's own ownership record and never searches the filesystem.
Codex has no equivalent, so Codex workers are the one harness we cannot bind
without either searching session directories or consuming message text.
What we observed (codex-cli 0.155.0)
codex exec --jsonemitsthread.started {thread_id}as its first event:
the thread id, but no rollout path.- The
notifyprogram atagent-turn-completereceivesthread-id,
turn-id,cwd,client— plusinput-messagesand
last-assistant-message, i.e. message content. No path. - Project hooks (
SessionStart/Stop) do not fire inexecmode, so there
is no hook channel for workers. - The rollout file (
~/.codex/sessions/YYYY/MM/DD/rollout-<local-ts>-<thread-id>.jsonl)
exists from thread start and its firstsession_metarecord carries
id+cwd, which is a fine ownership record to verify against — but
reaching the path from the thread id means listing date directories across
a local-time boundary, which is a heuristic search, not attestation. - No flag pins a thread id (no
--session-idanalog), so attestation by
construction is unavailable too.
The ask (either half unblocks us; both is best)
- Attest the path: include the rollout file's absolute path in a
content-free payload the worker channel already emits — e.g. apath/
rollout_pathfield on theexec --jsonthread.startedevent and/or in
thenotifyprogram's JSON argument. - Pin the identity: accept a caller-supplied thread id
(e.g.codex exec --thread-id <uuid>), the analog of
claude --session-id, so the spawner mints identity and the harness
reports where the file is.
Privacy posture
The attestation must be content-free: path + thread id + cwd only, the same
posture as Claude/Pi attestation. Concretely, a notify payload used for
attestation should be consumable without the input-messages /
last-assistant-message fields — either a separate minimal event or
documented permission to ignore those fields. We will read only thread-id
and cwd plus the new path field, and never message text.
Why not the alternatives
- Parsing
notify's message fields is a privacy regression we do not want. - Deriving the path by scanning date directories is exactly the filesystem
search our design refuses (racy across the local-time boundary, breaks
under concurrent workers). - Binding only at turn end loses the first turn's usage, which is usually the
most expensive turn.
Happy to test a preview build and report back. Thanks for considering it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the codex exec --json thread.started event and the notify program's agent-turn-complete JSON arguments. Review the rollout file's session_meta record and the existing thread_id, cwd, and content fields described in the issue. Done means workers can attest the rollout path or caller-supplied thread identity using only content-free path, thread id, and cwd data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100