[Windows][Regression] Deleted local Codex tasks remain in local_thread_catalog and reappear after restart
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What version of the Codex App are you using (From “About Codex” dialog)?
Codex Desktop 26.820.10647.0; Codex CLI 0.150.1 (windows-x86_64).
What subscription do you have?
ChatGPT authentication. Exact plan omitted from this public report.
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64 (Windows 11).
What issue are you seeing?
Local Codex tasks that were archived and deleted reappear in the Desktop sidebar after a full restart. The affected entries include local CLI and VS Code tasks, including dispatched worker/audit tasks. They reappear under both Recents and project sections, making deletion state unreliable and heavily cluttering the sidebar.
The immediate source of the resurrection is ~/.codex/sqlite/codex-dev.db, table local_thread_catalog: stale rows remain there even after the corresponding canonical thread rows and rollout files are gone.
What steps can reproduce the bug?
- Archive multiple local Codex tasks.
- Delete them from Settings > Archived chats/tasks.
- Confirm that they disappear from the visible list.
- Fully quit Codex Desktop and VS Code.
- Reopen Codex Desktop.
- Observe that deleted tasks reappear in Recents and project sections.
This has reproduced repeatedly across complete app restarts.
What is the expected behavior?
Deleted local tasks should remain deleted after restart. Desktop reconciliation should remove or tombstone the matching local_thread_catalog rows when the canonical local thread no longer exists. A stale catalog entry whose thread row and rollout are both absent should also be locally removable without requiring a valid rollout.
Additional information
I performed a controlled diagnostic with Codex Desktop and VS Code fully stopped:
- Backed up the local state before making any changes.
- Removed 18 exact thread rows from
state_5.sqlite. - Moved the 18 exact matching rollout files out of both
sessionsandarchived_sessionsinto a quarantine directory. PRAGMA integrity_checkreturnedok.- After restart, all 18 exact IDs were absent from
state_5.sqliteand no matching rollout files existed undersessionsorarchived_sessions. - Despite that, the same entries were still rendered in the Desktop sidebar.
A subsequent read-only inspection found:
codex-dev.db / local_thread_catalog exact-ID matches: 18
source_kind=cli: 15
source_kind=vscode: 3
host_id=local: 18
missing_candidate=0: 18
codex-dev.db integrity_check: ok
The local catalog sync state had initial_build_complete=1, and its observation sequence/incremental watermark continued advancing, while the last full-reconciliation timestamp predated the incident. This suggests that deletion/missing-thread tombstones are not being propagated into local_thread_catalog, and incremental startup reconciliation does not prune these rows.
Current codex doctor also reports local inventory parity problems, while all inspected databases pass integrity checks:
active rollout files: 467
active DB rows: 414
missing active rows: 53
duplicate rollout thread IDs: 53
missing archived rows: 0
malformed filenames: 0
scan errors: 0
Relationship to existing reports:
- This looks like a Windows regression of the stale local ghost-thread family reported in #29868, which is currently closed as completed. The current reproduction is on a much newer Desktop build.
- It is related to #28298, but that report primarily shows underlying archived thread rows/rollouts surviving bulk delete. Here, the 18 exact canonical rows and rollout files were removed, but the separate
local_thread_catalogrows remained and continued driving the sidebar. - It resembles the stale sidebar reconciliation in #39989, but those are deleted ChatGPT cloud conversations. These 18 entries are local Codex
cli/vscodetasks withhost_id=local.
Exact thread IDs, titles, account identifiers, usernames, private local paths, conversation contents, screenshots, tokens, and credentials are intentionally omitted. A separate private OpenAI Support report contains the fuller diagnostic context.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the local startup reconciliation that populates codex-dev.db's local_thread_catalog, using the reported 18 stale IDs and the state_5.sqlite and rollout-file checks as the reproduction. Done means deleted local cli and vscode tasks stay absent after a full restart, including catalog rows whose canonical thread and rollout are both missing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, sqlite
- Domain
- databases, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100