Repository navigation
Description
What version of the Codex App are you using?
Codex task-management API surface in Codex Desktop.
- Bundled runtime recorded by the affected session: codex-cli 0.150.0-alpha.8
- Current local CLI: codex-cli 0.149.1
- Platform: macOS Darwin 24.6.0 arm64
- Affected task source: vscode
- Model: not surfaced in the session metadata
What issue are you seeing?
After a target task performs context compaction, a cross-thread read can silently omit the target task's latest completed assistant response.
The task completes normally and the raw rollout JSONL contains the final assistant message. However, the thread-management API reports the latest turn as completed while returning an empty item list and no latest assistant message. This makes read-only cross-thread review and handoff retrieval fail even though the response is persisted locally.
The compaction correlation is evidence from one reproduction, not a confirmed causal mechanism.
Reproduction
- Use a sufficiently long-running Codex task that performs context compaction.
- From another task, send a read-only review request to that task.
- Wait for the target task to finish.
- Call
wait_threadsand thenread_threadfor the exact target thread ID. - Observe that the target turn is completed, but its retrievable items are empty.
- Inspect the local rollout JSONL and observe that the assistant response is present.
Affected task:
01a03fe0-2471-7ec2-a29f-6117f1f3f022
Observed local rollout evidence:
compactedrecord at ordinal 2015, timestamp 2026-08-26T21:26:58.831Z- assistant
response_itemat ordinal 2093 task_completeat ordinal 2095, with a non-emptylast_agent_messageread_thread/wait_threadsresult: latest turn completed, butitems: [],latestAssistantMessageId: null, andlatestAssistantMessage: null
The raw response remains in:
~/.codex/sessions/2026/08/26/rollout-2026-08-26T23-00-49-01a03fe0-2471-7ec2-a29f-6117f1f3f022.jsonl
Older assistant messages from the same task were retrievable, so this is not simply lack of access to the task.
Expected behavior
A completed target turn should expose its assistant response through read_thread, regardless of whether context compaction occurred. If transcript hydration fails, the API should return an explicit error or incomplete-state marker rather than a successful completed turn with an empty transcript.
Actual behavior
The status path correctly observes completion, but the transcript path silently drops the latest response. Repeated waiting does not restore it. Reading the raw rollout JSONL recovers the response, but that is an internal, unsupported fallback and is not available for remote tasks.
Related issues
- [CLI/TUI] thread/resume silently drops the newest turns on heavily compacted threads #38169: heavily compacted
thread/resumesilently drops newest turns - Codex App loses thread history after cross-thread delegation messages #37030: cross-thread delegation can lose model-visible thread history
- Codex Desktop should expose exact current and past chat transcripts to the assistant when the user asks #28193: exact transcript access for the assistant
- Codex Desktop: chats disappear after update/import; imported threads open blank despite JSONL turns #20493: blank thread views despite intact local JSONL transcripts
This report is narrower: the target task completes, local storage contains the assistant message, but the cross-thread read_thread result omits it after compaction.
Privacy
The raw transcript is not attached because it contains private project conversation and local paths. The rollout path, task ID, turn status, ordinals, and metadata above are sanitized evidence.
Activity
github-actions commentedon Aug 26, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
coolnames commentedon Aug 29, 2026
I reproduced the same completed-turn/empty-items contradiction on Codex Desktop for macOS 26.825.32147, bundled codex-cli 0.150.0-alpha.12.2, with a deterministic restart boundary.
A task created before a complete Desktop restart continues to accept and execute turns afterward. Its rollout JSONL contains commentary, tool calls, results, and a final response, but wait_threads reports null assistant/tool content and read_thread returns the correct completed turn with items: [].
Pre-restart history remains readable. A second post-restart turn in the same persisted task reproduces the failure. A new task created after the restart exposes full content normally through both APIs.
This isolates the condition to turns appended to a resumed pre-restart task, rather than a general monitoring outage. Shipped implementation inspection suggests the resumed paginated-history hydration path may reuse a stale conversation-level itemsBackwardsCursor for newly appended turns.
I have a complete controlled reproduction report and private rollout evidence. Feedback ID: 01a040f9-b215-70d3-866e-c7b9b2370289. Related: #40512 and #40014.
infinityfy commentedon Aug 30, 2026
I can reproduce the same failure on Codex Desktop for Windows, but without
requiring context compaction.
Additional evidence:
sessions originally created with 0.148.0-alpha.9 remain reliable on the
same current host.
the first post-restart turn completed but returned items=[] and
latestAssistantMessage=null.
rollout file size: 349430 bytes.
This narrows the affected sample to a reader/mapper/filter/cache failure after
history projection is already complete, rather than missing model output or a
lagging projection waterline.
I have a sanitized evidence report with exact turn IDs, ordinals, hashes, and
version comparisons. Raw transcripts and databases are not public because they
may contain private context.
dengdingchang commentedon Sep 8, 2026
Additional reproduction on a macOS Desktop coordinator reading an SSH-connected Linux task.
Environment observed on 2026-09-08:
Native history exists while Desktop task tools return empty items
For the same remote task and exact same completed turn:
thread/turns/listwithitemsView: "full": 14 items, including 3 agent messages.thread/readwithincludeTurns: true: the same 14 items and 3 agent messages.read_thread, explicitly targeting that SSH host: 0 items.This also reproduced for a later in-progress turn: native full history returned 26 items including 4 agent messages, while Desktop returned 0 items for the same turn. A separate native
thread/items/listrequest with a null cursor returned complete items too. No resume, restart, or interruption of the target task was needed.Pagination hypothesis, not a confirmed root cause
A read-only experiment with server-issued opaque cursors reproduced a potential failure mechanism:
backwardsCursorfrom an older turn's item page.cursor: null, the latest turn returned 51 items and no next page.The installed Desktop's paginated history path appears to reuse a conversation-level item boundary when hydrating individual turns. We have NOT captured the actual Desktop cursor used in the failing request, so this remains a candidate explanation. Please check whether full-history task-tool reads inadvertently inherit an older UI pagination boundary. A regression covering an old boundary plus a new turn may help. An explicit incomplete-history result would also be preferable to silent empty items.
Separate remote callback capability question
In the affected remote task context, task read/wait tools are available but
send_message_to_threadis not exposed. The coordinator can send into the remote task. Is there a supported remote-to-coordinator result callback path, or is the missing outbound tool an intentional current limitation? This is separate from the empty-history defect; we are not claiming they share a root cause.A bounded workaround was tested: the Mac initiates SSH, registers native
fs/watchon the remote rollout, and reads full history afterfs/changed. A local observer can then relay a sanitized report to its coordinator. This is Mac-initiated observation, NOT remote task-initiated delivery, and it does not repair native cross-thread callbacks or persist after the observer exits.No signed app, tool filters, SSH permissions, or business task configuration were modified. Private transcripts, task identifiers, host addresses, credentials, and project paths are intentionally omitted.