[Regression][macOS Desktop] Orphaned “New task” sidebar entries cannot be archived or deleted
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- PR merge metrics
- PR metrics pending
Description
Summary
Codex Desktop created 12 phantom sidebar entries titled New task / 新任务. The entries had voice-waveform icons and could not be opened, archived, or deleted through the normal UI.
This appears to be a recurrence or incomplete fix of #32578.
Environment
- Platform: macOS (Apple Silicon)
- App: Codex Desktop / ChatGPT Desktop powered by Codex
- Date reproduced: 2026-08-15
- Locale: Chinese
The exact app version was not available from the current diagnostic session.
Actual behavior
- Multiple sidebar entries named
新任务appeared in two tightly clustered batches. - The normal thread-list API did not return these entries.
- Attempts to archive their thread IDs returned:
No Codex thread found for threadId: <redacted>. Hosts without a readable match: local - The entries therefore could not be removed through either the UI or the supported archive operation.
Local-state evidence
The 12 IDs were present in:
~/.codex/.codex-global-state.json → projectless-thread-ids
However, there were no matching rollout/session files under:
~/.codex/sessions/~/.codex/archived_sessions/
This indicates the sidebar index was persisted even though task/rollout creation did not complete.
No private paths, prompts, account identifiers, or raw logs are included here.
Workaround that succeeded
- Back up
~/.codex/.codex-global-state.json. - Remove only the 12 stale IDs from
projectless-thread-ids. - Validate the resulting JSON and restart/refresh Codex.
After cleanup, the stale-ID intersection count was zero.
Expected behavior
- A sidebar entry should be committed only after its underlying thread/rollout is durable.
- If task initialization fails, the pending sidebar entry should be rolled back.
- Startup reconciliation should automatically prune or quarantine
projectless-thread-idsthat have no corresponding readable thread/rollout. - Archive/delete should handle orphaned sidebar records instead of returning “No Codex thread found.”
Suggested fix
Use transactional/atomic creation across thread persistence and sidebar indexing, plus a reconciliation pass that validates persisted sidebar IDs against the thread store. A safe “remove stale task reference” operation would also let the UI recover without manual JSON editing.
Related: #32578
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 with ~/.codex/.codex-global-state.json and the projectless-thread-ids entry, then inspect the creation and startup reconciliation paths against ~/.codex/sessions/ and ~/.codex/archived_sessions/. Done means failed task initialization leaves no sidebar entry, stale IDs are pruned or quarantined, and archive/delete no longer reports that the Codex thread is missing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100