`codex exec resume` can append to a Desktop session transcript without updating the Desktop session index/UI reliably
What version of Codex are you using?
codex-cli 0.140.0-alpha.2
The affected session was originally created from Codex Desktop. I do not want to
include raw session ids or local transcript excerpts in the public report, but I
can provide a more sanitized excerpt if it would help.
What platform is your computer?
macOS / Darwin arm64
What is the issue?
I observed a codex exec resume <session-id> - --output-last-message <file> run
append a new turn to an existing Codex Desktop-originated session transcript, but
the Desktop session index did not update to the resumed turn time. The new turn
was also not reliably visible in Codex App immediately afterward.
The important part is that this did not look like model failure or data loss:
the transcript file received the user message and assistant response, and--output-last-message captured the assistant response. The unclear part is the
Desktop/index visibility contract after the CLI resume.
Steps to reproduce
- Start with an existing Codex Desktop session that has a recorded session id.
- From a shell, run:
``bash``
codex exec resume <session-id> - --output-last-message /tmp/codex-last-message.txt
with a short prompt on stdin.
- Confirm that the corresponding
~/.codex/sessions/**/rollout-*<session-id>.jsonl
file receives:
- a new
usermessage for the resume prompt; - a new assistant response;
- a later file mtime matching the resumed turn.
- Check the corresponding row in
~/.codex/session_index.jsonl. - Reopen or inspect the same session in Codex Desktop.
Expected behavior
One of these would be reasonable:
codex exec resumeupdates the same durable session/index state that Codex
Desktop uses, so the resumed turn is visible in the App in a predictable way;
- or the CLI documents that
codex exec resumeis a transcript/CLI resume path
and does not guarantee Desktop UI/index refresh;
- or there is a supported command/API to refresh/reindex a session after CLI
resume.
Actual behavior observed
In one local repro:
codex exec resume ... --output-last-message ...completed.- The target session JSONL received the new turn and assistant response.
- The JSONL file mtime advanced to the resumed turn time.
- The
session_index.jsonlrow for the same session still had the older
updated_at.
- The resumed response was not visible in Codex App immediately afterward.
- Later, the App appeared to show the response, but I could not tell whether
that was due to a refresh, reload, or some other delayed readback.
So the practical issue is not "the resume failed"; it is that transcript
persistence and Desktop UI/index visibility appear to be separate states, and
the boundary is hard to reason about for tools that use codex exec resume as a
handoff mechanism.
Why this matters
This affects local automation and orchestration around Codex Desktop sessions.
If a tool sends a correction or handoff to an existing Desktop session throughcodex exec resume, it needs to know whether the user will see that turn in
the App. Today the tool can prove that the transcript was updated, but not that
the Desktop session list/view was updated.
Related issues
Related, but not exact duplicates:
- #22796 covers Desktop sidebar/project history not showing local sessions.
- #23345 covers Codex App rendering failure after structured-output messages
produced by codex exec resume.
- #24016 covers promptless follow mode for
codex exec resume. - #25914 covers a broader app-server/Desktop active-thread discovery and
attachment contract.
This issue is specifically about the sync/visibility boundary aftercodex exec resume appends to an existing Desktop-originated session.
7 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Thanks for the duplicate suggestion. I reviewed #28068 and agree it is closely
related, but I do not think this report is an exact duplicate.
The shared theme is local session indexing/registration: session data can exist
on disk while the CLI/App index view does not reflect it reliably.
The difference in this report is the narrower
codex exec resumepath:codex exec resume <id> - --output-last-message <file>completed;--output-last-messagecaptured the assistant response;session_index.jsonlrow still had the olderupdated_at;So this is not primarily about recovering historical sessions from disk. It is
about whether
codex exec resumeshould update the Desktop-visible sessionindex/UI, or whether the CLI should document that transcript persistence does
not guarantee Desktop UI/index refresh.
Additional observation: I narrowed this down further, and it no longer looks like only a stale
session_index.jsonl.updated_atrow.The useful inspection checklist was:
codex exec resumeagainst that session so it appends a new turn to the existing transcript.session_index.jsonlrow has anupdated_atvalue at least as new as the latest transcript timestamp.state_5.sqlitethreads.updated_at_msvalue is also at least as new as the latest transcript timestamp.In my local test, steps 3-5 were all true, but the appended response still did not render in the existing Desktop UI thread.
I understand that manually editing local app state is not a supported workaround. I only used it, after making a backup, to narrow the diagnosis. This observation suggests the issue is not only a stale
session_index.jsonlrow; there may be another Desktop-side cache, readback, or transcript refresh boundary aftercodex exec resumewrites to a Desktop-originated session.codex exec resumeshould update the transcript and session index in the same lifecycle step.After appending a turn, write an index event with session id, source transcript path, old/new updated_at, appended turn id, output file path if used, and origin
exec-resume. Desktop can watch that event or rebuild from it instead of relying on a separate stale scan.---
_Generated with ax._
Additional Windows/subagent-origin reproduction focused specifically on communication and execution identity.
Environment
OpenAI.Codex_26.727.6591.0_x64__2p2nqsd0c76g0originator = Codex Desktopthread_source = subagenthistory_mode = legacycli_version = 0.146.0-alpha.9.2codex-cli 0.142.0gpt-5.4; the Desktop target was usinggpt-5.6-solThe CLI/Desktop version and model mismatch is an important caveat and should itself have prevented treating the result as delivery to the active Desktop agent.
Observed behavior
``
``codex exec resume <target-session-id> <handoff-prompt>
thread.startedwith the exact requested session UUID.task_complete.The target session ID was not mistyped and no different thread UUID was selected. Instead,
codex exec resumecreated a separate CLI execution context from the saved transcript associated with that UUID. That continuation processed the prompt, while the original visible/live Desktop agent did not receive it.Communication failure
This shows that a unique durable session UUID is not, by itself, a unique live-agent address:
thread.startedechoed the expected session UUID;A caller can therefore mistake “same session id + transcript append + task complete” for delivery to the intended live agent. The missing distinction is between:
This is related to the live-agent-vs-durable-thread distinction discussed in #32547, but here the failure is that an external continuation under the durable thread identity does not reach the visible target agent.
Safer expected behavior
At least one of these should hold:
codex exec resumeattaches to and reconciles with the Desktop-visible execution context before reporting success;Machine-readable fields could include:
Most importantly, a returned session UUID and a completed appended turn must not be usable as evidence that the intended live agent received a message.
Raw session IDs, local paths, project names, and conversation contents are intentionally omitted.
Hi @bakemocho, your report looks related to a local session discovery/inventory gap rather than necessarily a lost rollout. I've released Codex Rescue Alpha5, a local read-only diagnostic tool that performs filesystem-first discovery across active and archived rollouts and cross-references SQLite/index metadata without modifying any state.
If you still have the affected local Codex directory, you can inspect it via:
No raw files or databases are needed. If you choose to share output, please review and sanitize any private repository paths or names first.
Note for anyone else reading this thread before running the suggested command.
Some checkable facts about the comment above, all from public metadata:
0.1.0a5was published to PyPI at 11:49Z; this comment was posted at 12:02Z, roughly thirteen minutes later.shleder) than the one commenting.I have not installed the package and I'm making no claim about what it does — it may well be a genuine tool being promoted badly. But
pip installexecutes code from the package at install time, and this one is being pitched specifically to people whose session directories contain their own conversation transcripts, with a follow-up suggestion to share the output. Note also that reading the project's source repository would not settle the question, since the published wheel is a separate artifact from the repository.If you want the diagnostic, get it deliberately rather than from an unsolicited comment: read the source, install a pinned version into a throwaway virtualenv, and don't paste raw output anywhere.