[Regression][macOS Desktop] Orphaned “New task” sidebar entries cannot be archived or deleted
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
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
The orphaned
projectless-thread-idswith no corresponding readable rollout are a useful discovery/reconciliation case forcodex-rescue. I’m field-testing whether it can enumerate the durable session store without being confused by sidebar-only phantom IDs, and whetherdoctorstays conservative when UI/global-state references do not resolve.If you still have a backup from before manual cleanup, could you run:
I’m specifically interested in whether the 12 phantom entries are ignored/quarantined rather than surfaced as recoverable sessions. Rescue should not edit
.codex-global-state.jsonas part of this test.Sanitized output + versions/exit codes only, please—no global-state file, rollouts/SQLite, prompts, credentials, or private paths. Repo: https://github.com/shleder/codex-rescue