Repository navigation
Description
Environment: Windows; Codex desktop package 26.901.5280.0; running backend codex-cli 0.153.4.
Observed: September 5, 2026.
What happened
I had an archived task named “Cleanup plan” and a fork named “Cleanup plan (2).” Both were visible when I clicked Delete all in Archived chats. The operation displayed “Failed to delete archived chats.” Afterward, only “Cleanup plan” appeared in the archive list, and further deletion attempts failed.
Expected: Both selected archived tasks should be deleted, with fork dependencies handled correctly. If deletion cannot complete, the app should identify the blocking task and preserve a way to manage it.
Findings verified before repair
- Both tasks still had archived database records and transcript files. Both were readable through the app's task-reading API.
- The fork's transcript metadata contained
history_base.thread_idreferencing the original task. - The original's stored
previewwas 543 characters; the fork'spreviewwas empty. - A live
thread/listrequest using{"archived":true,"limit":200,"useStateDbOnly":true}returned only the original, withnextCursor: null. The existing fork was omitted. - The installed backend contains the list predicate
AND threads.preview <> ''. - The installed desktop's global Delete All implementation uses that database-only archived listing, calls
thread/deletesequentially in returned order, and stops at the first unrecovered error. It does not explicitly order tasks by fork dependencies. - The installed backend contains the rejection template
cannot delete thread <id>: forked history still references it. This was found in executable strings; it was not captured as the response to the original failed click.
Repair and verification
With explicit permission, an assistant used the same running backend version's standard thread/delete API to delete the fork first, then the original. Both requests returned success (result: {}).
The two task records, their transcript files, and the original's seven spawned subagent histories were verified removed. Their indexed history/catalog records were absent, the archived list was empty, and no unrelated pre-existing task records were removed. No direct database edits were used.
Suspected cause and limits
The strongest explanation is that an archived fork with an empty preview is omitted from the list used for bulk deletion, while its retained history reference still blocks deletion of the original. The successful fork-first repair supports this explanation.
The original response error and exact original batch contents were not retained, so the complete failure sequence is not proven. It is also unknown why the fork's preview was empty. This should not be described as confirmed evidence that the app simply sorted the parent ahead of the fork: documented default listing order is newest-created first, which would normally place the newer fork first if included.
Please investigate the mismatch between archived tasks eligible for deletion and tasks included in the bulk-deletion list, plus handling and reporting of fork dependencies during partial failures.
Related report
Related: #40365 reports Delete All aborting when an active fork references an archived source. In this case, the dependent fork was also archived, remained readable, and was omitted from the database-only archived list because its preview was empty. The added issue is that an intended archived deletion target can become undiscoverable while retaining the dependency.
References
Conversation contents, local account paths, actual task identifiers, and raw diagnostic files are omitted.
Activity
github-actions commentedon Sep 5, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
jos-host commentedon Sep 10, 2026
Additional verified case on Windows that appears to be a persistent legacy-data variant of this issue.
Environment
History
Direct evidence
thread/deletemethod for each source returned JSON-RPC-32600:session_metacontained bothpayload.forked_from_idandpayload.history_base.thread_idpointing to its source.thread/listqueries using each source asancestorThreadIdreturneddata: []for botharchived: falseandarchived: true.Repair and verification
thread/delete.thread/delete.result: {}and emittedthread/deleted.This strengthens the hypothesis that the dependency guard can still detect a persisted fork reference while descendant enumeration/cascade deletion cannot discover that same fork. The fact that most old affected records became deletable after upgrades, while these two persisted, suggests an uncovered legacy migration/index subtype rather than a universal current deletion failure.
Actual task titles, thread IDs, local paths, and conversation contents are omitted.
jos-host commentedon Sep 16, 2026
Additional verified reproduction on Windows (2026-09-17), now affecting single-item deletion, not only “Delete all”.
Current case
forked_from_idandhistory_base.thread_idreferences to the visible parent.This further supports the root cause described in this issue: the deletion guard can see a fork reference that the management UI cannot enumerate or expose. It also confirms that the bug is not limited to bulk deletion.
Feedback was additionally recorded through Codex
/feedbackwithout uploading logs. Feedback thread:01a0aaff-72dd-7102-b559-5526788b969a.Requested behavior
Archive and deletion represent different user intentions. Requiring every deletion to pass through Archive adds friction and makes dependency failures harder to understand and recover from.
sudazc commentedon Sep 23, 2026
Additional Windows reproduction on 2026-09-23, affecting single-item deletion:
thread/deletereturned JSON-RPC-32600:cannot delete thread <redacted>: forked history still references it.thread/read. Unlike the empty fork described in an earlier comment, this fork contains its own conversation history.Real task IDs, titles, local paths, and transcript contents are omitted.
edwardswhiskeyblues-alt commentedon Oct 10, 2026
Additional verified reproduction on Windows, observed and repaired on 2026-10-11. This confirms the problem persists in a substantially newer build and adds compaction/CLI behavior.
Environment
Observed behavior
Cannot delete task.-32600:cannot delete thread <redacted>: forked history still references it.codex delete <source UUID> --forceexited 1 with onlyError: failed to delete session, so the CLI did not expose the actionable dependency reason either.Repair and verification
codex delete --forcecommand.codex doctorreported healthy databases and agreement between rollout files and the state database after deletion.This adds three useful data points to the existing report: the issue persists in Desktop 26.1007 / runtime 0.162, successful compaction does not repair the dependency, and both the UI and stable CLI suppress the actionable fork-reference error even though the app-server log contains it.
Task names, thread IDs, local paths, project content, and other private data are omitted.
goodman-oai commentedon Nov 16, 2026
Closing as completed for the reported Delete All case where the source and its empty-preview forks are all archived. On 0.153.4, the archive listing returned only the parent and deletion failed. On 0.169.0, the same data listed grandchild, child, then parent. Deleting in that order removed all three records and transcripts. I verified the app-server calls used by Desktop. Archived-list fix.