Skip to content

codex exec resume silently starts a new thread when given an ephemeral session id #15538

@aquiles-ai123

Description

@aquiles-ai123

codex exec resume silently starts a new thread when given an ephemeral session id

Summary

If I run codex exec --ephemeral, capture its thread_id, and then pass that id to codex exec resume, Codex does not report that the ephemeral session is unavailable.

Instead, it silently starts a brand-new thread with a different thread_id and no prior context.

That is misleading because the provided session id looks accepted, but the resumed run is not actually attached to that session.

Repro

Create an ephemeral session:

codex exec --ephemeral --skip-git-repo-check --color never --json -C /home/cryptotrading74 \
  "Reply with the single word ok and stop." \
  > /tmp/codex_ephemeral_probe.jsonl

Observed transcript:

{"type":"thread.started","thread_id":"019d1c08-c1b4-70c2-955f-840a5022c017"}
{"type":"item.completed","item":{"id":"item_0","type":"agent_message","text":"ok"}}

Now try to resume that ephemeral session id and ask about the previous reply:

codex exec resume 019d1c08-c1b4-70c2-955f-840a5022c017 --json --skip-git-repo-check \
  "What was your previous one-word reply in this session? Answer with just that word." \
  > /tmp/codex_resume_ephemeral_probe.jsonl

Observed transcript:

{"type":"thread.started","thread_id":"019d1c09-942e-78c3-9a83-06c571abddc8"}
{"type":"item.completed","item":{"id":"item_0","type":"agent_message","text":"None"}}

Two problems are visible:

  • the resumed run starts a different thread_id
  • it does not have the prior ok context

Control

The normal non-ephemeral path resumes correctly.

Create a regular session:

codex exec --skip-git-repo-check --color never --json -C /home/cryptotrading74 \
  "Reply with the single word zebra and stop." \
  > /tmp/codex_resume_control_seed.jsonl

Observed thread:

{"type":"thread.started","thread_id":"019d1c0a-0137-73f3-bf4a-88c90739150c"}

Resume it:

codex exec resume 019d1c0a-0137-73f3-bf4a-88c90739150c --json --skip-git-repo-check \
  "What was your previous one-word reply in this session? Answer with just that word." \
  > /tmp/codex_resume_control_check.jsonl

Observed transcript:

{"type":"thread.started","thread_id":"019d1c0a-0137-73f3-bf4a-88c90739150c"}
{"type":"item.completed","item":{"id":"item_0","type":"agent_message","text":"zebra"}}

So resume itself works; the broken behavior is specific to passing an ephemeral session id.

Expected behavior

One of these should happen:

  • codex exec resume <ephemeral-id> should fail clearly with a "not found / ephemeral sessions are not resumable" style error
  • or, if ephemeral sessions are intended to be resumable during the current process lifetime, it should actually resume the same thread and preserve context

Actual behavior

codex exec resume appears to accept the ephemeral session id, but silently starts a new thread with no prior context.

Why this matters

This is easy to misread as a successful resume. Automation or humans can believe they resumed a session when they actually started a fresh one.

Files / artifacts

  • /tmp/codex_ephemeral_probe.jsonl
  • /tmp/codex_resume_ephemeral_probe.jsonl
  • /tmp/codex_resume_control_seed.jsonl
  • /tmp/codex_resume_control_check.jsonl

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingexecIssues related to the `codex exec` subcommand

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions