Skip to content

[Windows] Delete All archived chats leaves a hidden archived fork that may block its source #43106

Closed

Description

@Vulcan-Approach

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_id referencing the original task.
  • The original's stored preview was 543 characters; the fork's preview was empty.
  • A live thread/list request using {"archived":true,"limit":200,"useStateDbOnly":true} returned only the original, with nextCursor: 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/delete sequentially 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

  1. added
    bug
    app
    windows-os
    app-server
    on Sep 5, 2026
  2. github-actions commented on Sep 5, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. jos-host commented on Sep 10, 2026

    @jos-host

    Additional verified case on Windows that appears to be a persistent legacy-data variant of this issue.

    Environment

    • Windows 10 Pro 10.0.19045 x64
    • Codex Desktop 26.903.8094.0
    • App-server / CLI 0.149.1
    • Observed and repaired: September 10, 2026

    History

    • The user originally had roughly ten archived tasks that could not be deleted.
    • After two or three Codex Desktop upgrades, most became deletable normally.
    • Two older archived source tasks remained undeletable across upgrades. Newer archived branches can be deleted normally, so this is not a general failure for all current records.

    Direct evidence

    • Deleting either remaining source through the UI produced the generic “Unable to delete archived chats” error.
    • Calling the documented thread/delete method for each source returned JSON-RPC -32600:
      cannot delete thread <id>: forked history still references it
      
    • Each source had exactly one archived fork record.
    • Each fork’s session_meta contained both payload.forked_from_id and payload.history_base.thread_id pointing to its source.
    • However, experimental thread/list queries using each source as ancestorThreadId returned data: [] for both archived: false and archived: true.

    Repair and verification

    1. Delete each archived fork directly with thread/delete.
    2. Delete its archived source with thread/delete.
    3. All four requests returned result: {} and emitted thread/deleted.
    4. The two visible sources disappeared from the archived list, all four rollout files were absent, and the unrelated archived task remained intact.

    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.

  4. jos-host commented on Sep 16, 2026

    @jos-host

    Additional verified reproduction on Windows (2026-09-17), now affecting single-item deletion, not only “Delete all”.

    Current case

    • One visible archived parent task repeatedly failed to delete through Settings → Archived chats → trash → confirm.
    • The failure persisted after a full Codex Desktop restart.
    • The parent had one hidden local fork that was not shown in the sidebar or Archived Chats.
    • The hidden fork’s rollout was only 2 JSONL records / 19,432 bytes, containing session metadata but no actual conversation messages.
    • Its metadata still contained both forked_from_id and history_base.thread_id references to the visible parent.
    • Temporarily detaching that empty hidden fork from the active session inventory immediately allowed the parent deletion to complete.
    • No unrelated archived task was affected.

    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 /feedback without uploading logs. Feedback thread: 01a0aaff-72dd-7102-b559-5526788b969a.

    Requested behavior

    1. Empty/failed forks with no conversation content should be cleaned automatically or ignored as deletion blockers.
    2. If a child contains content, deleting the parent should show a dependency-aware dialog:
      • Delete parent only — materialize/detach the child’s inherited history;
      • Delete parent and descendants;
      • Cancel.
    3. The error should name the blocking child task (title/ID) instead of only showing “Unable to delete archived chat”.
    4. Add two distinct task actions in the desktop app:
      • Archive — reversible hide;
      • Delete directly — permanent deletion with confirmation, without requiring the archive-first workflow.

    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.

  5. sudazc commented on Sep 23, 2026

    @sudazc

    Additional Windows reproduction on 2026-09-23, affecting single-item deletion:

    • The source task was archived; deleting it there first showed “无法删除已归档的聊天” (“Cannot delete archived chat”).
    • After unarchiving, the source appeared in the active task list and no longer appeared in the archived list. Deleting it from the active task list still showed “无法删除任务,请重试” (“Unable to delete task; please try again”).
    • The local desktop log for thread/delete returned JSON-RPC -32600: cannot delete thread <redacted>: forked history still references it.
    • The referenced fork is missing from both active and archived task listings but remains readable through 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.

  6. edwardswhiskeyblues-alt commented on Oct 10, 2026

    @edwardswhiskeyblues-alt

    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

    • Windows 11 Pro 10.0.26300 x64
    • Codex Desktop 26.1007.2314.0
    • Bundled app-server / CLI 0.162.0-alpha.17.2

    Observed behavior

    • Deleting one visible active task through the desktop UI repeatedly showed the generic red error Cannot delete task.
    • The desktop log recorded JSON-RPC -32600: cannot delete thread <redacted>: forked history still references it.
    • The blocking record was an archived migration-backup fork. It was not visible alongside the active source task during the deletion workflow.
    • A manual compaction of the source completed successfully in about 109.5 seconds, but did not remove or detach the fork reference. The source rollout grew by 9,547,822 bytes during that compaction, and deletion still failed afterward.
    • The documented CLI path also failed for the source: codex delete <source UUID> --force exited 1 with only Error: failed to delete session, so the CLI did not expose the actionable dependency reason either.

    Repair and verification

    1. Delete the hidden archived fork by UUID using the bundled codex delete --force command.
    2. Delete the visible source by UUID using the same command.
    3. Both commands returned success; deletion of the source also removed its spawned descendants.
    4. Read-only verification found no remaining thread rows, spawn edges, or rollout files for the deleted lineage.
    5. codex doctor reported 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.

  7. goodman-oai commented on Nov 16, 2026

    @goodman-oai
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appapp-serverbugwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions