Missing rollout leaves an unarchivable ghost thread in the Windows sidebar
Bug: Missing rollout leaves an unarchivable “ghost” thread in the Windows sidebar
Summary
On the Codex/ChatGPT Windows desktop app, a local thread remained visible in the sidebar and repeatedly failed to archive because its rollout file was missing while the state database still retained the thread row and stale rollout path. The item survived full app restarts and was also treated as a pinned thread by the renderer even after the backend could no longer load it.
The UI eventually reported archive success only after the stale local state was cleaned up and an explicit unpin operation was sent. The app should self-heal this state without requiring manual SQLite/session cleanup.
Environment
- Platform: Windows 10 Home China 22H2, build 19045.6466, x64
- Desktop app release reported in logs:
26.814.41957 - App server version:
0.148.0-alpha.15 - Selected Codex runtime bundle:
26.819.11345 - Date observed: 2026-08-20
- Thread title:
11 - Thread ID:
01a01437-8518-78d2-8485-d0512fcbc1c5 - Deep link:
codex://threads/01a01437-8518-78d2-8485-d0512fcbc1c5
Preconditions inferred from logs and local state
state_5.sqliteretained a row for the thread.- Its
rollout_pathpointed to a JSONL file that no longer existed. - The renderer/sidebar still retained the thread in its pinned/recent state.
The stale path was equivalent to:
%USERPROFILE%\.codex\sessions\2026\08\18\rollout-...-01a01437-8518-78d2-8485-d0512fcbc1c5.jsonl
Steps to reproduce
The original cause of the missing rollout is unknown, but the broken state can be described as follows:
- Have a local thread row in
state_5.sqlitewhoserollout_pathno longer exists. - Keep that thread visible or pinned in the sidebar.
- Restart the desktop app.
- Try Archive from the thread overflow menu, sidebar context menu, or Recent tasks menu.
Actual behavior
- The app repeatedly shows archive failure.
- Restarting does not remove the sidebar item.
- The stale thread can remain visible even though
thread/readandturn/startreport that the thread is missing/not loaded. - Archive may fail through two related paths:
- internal OS error because the rollout file is missing;
no rollout found, followed by failure to persist the inactive-thread archive.
- The renderer can continue trying to hydrate the item as a pinned thread.
Expected behavior
If a thread's rollout is missing but a state-database/sidebar record remains, Archive should still remove the item from active and pinned sidebar state. The app should transactionally reconcile or quarantine the stale database row, clear its pinned state, invalidate the renderer cache, and optionally surface a recoverability warning. It should not require the missing rollout file merely to hide/archive the sidebar entry.
Sanitized log evidence
Archive requested ... method=thread/archive
errorCode=-32603
failed to archive session: thread-store internal error: failed to archive thread:
The system cannot find the file specified. (os error 2)
Archive skipped because thread has no active rollout
errorMessage="no rollout found for thread id 01a01437-8518-78d2-8485-d0512fcbc1c5"
Failed to persist inactive thread archive
errorMessage="Inactive thread archive did not persist"
state db list_threads returned stale rollout path for thread
01a01437-8518-78d2-8485-d0512fcbc1c5
state db discrepancy during list_threads_db: stale_db_path_retained
thread/read ... errorCode=-32600
message="thread not loaded: 01a01437-8518-78d2-8485-d0512fcbc1c5"
Failed to read pinned thread
threadId=01a01437-8518-78d2-8485-d0512fcbc1c5
Recovery that ultimately worked
The user observed successful archiving only after all of the following stale state had been reconciled:
- removed the stale thread row and exact-ID references from local structured state;
- confirmed the missing rollout/session file had no remaining live index entry;
- explicitly set the thread's pinned state to false;
- retried Archive in the desktop app.
Suggested fix
When thread/archive encounters rollout_not_found or OS error 2:
- fall back to a state-database-only archive transaction;
- clear
is_pinnedand any renderer-side pinned ID for the thread; - invalidate the sidebar query/cache;
- remove or quarantine stale
rollout_pathentries; - return success if the thread is no longer present in active sidebar state.
This would prevent a permanently visible “ghost” thread and avoid requiring users to edit local databases manually.
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
- #39182
Powered by Codex Action
Additional reproduction from the same day, with a different failure variant:
Environment
- Windows 11 x64, zh-CN
- Codex Desktop package:
OpenAI.Codex 26.818.2441.0 - Codex CLI:
0.148.0-alpha.21 - Observed: 2026-08-20, Asia/Shanghai (UTC+8)
Important difference
For this affected thread, the rollout JSONL file exists and is readable. The thread is also present in session_index.jsonl, and codex doctor --summary reports that the state database is healthy and the rollout/thread inventories agree.
Despite that, all archive paths fail:
thread/archive
errorCode=-32600
failureReason=rollout_not_found
message="no rollout found for thread id ..."
The CLI reports:
failed to archive thread: The system cannot find the file specified. (os error 2)
Recovery attempts
- Restarted Codex Desktop twice.
- Verified the rollout file and session-index entry.
- Ran a targeted dry-run:
codex migrate-rollouts --thread <redacted-thread-id> --json --verbose- Result:
eligible
- Result:
- Ran the same targeted migration with
--apply.- Result:
migrated - Approximately 1.1 MB processed.
- Result:
- Restarted the desktop app again.
After migration, the task became readable/idle, but Archive still fails with OS error 2. No conversations were deleted; backups were made before migration.
A second completed task also intermittently appears as notLoaded after restart. This may indicate that the archive path resolver is using a stale or differently normalized rollout path even when the file and catalog entry both exist.
Please consider handling rollout_not_found/OS error 2 by reconciling the state DB, session index, and resolved rollout path before failing the archive operation. I can provide a focused sanitized log excerpt and screenshot if needed.
Hi, on Windows I was able to solve the issue with the following steps:
- Completely close the ChatGPT desktop app (Exit from the system tray).
- Go to
%USERPROFILE%. - Delete the
.codexfolder. - Reopen the ChatGPT desktop app. The initial configuration will start again.
- Follow the setup steps.
After completing the setup, the ghost chats are no longer present.
This worked for me without having to manually edit the SQLite database or individual session files.
I reproduced a related case after manually deleting local rollout/session files. Archive failed with Inactive thread archive did not persist, and the ghost task remained in the sidebar.
A local workaround that removed the ghost entry:
- Back up
~/.codex/session_index.jsonland~/.codex/sqlite/codex-dev.db. - Remove only the affected
thread_idfrom every matching line insession_index.jsonl. - In
codex-dev.db, remove the matching row fromlocal_thread_catalog, then incrementlocal_thread_catalog_metadata.catalog_revision. - Restart Codex Desktop.
Removing session_index.jsonl entries alone was insufficient; the stale local_thread_catalog row kept the item visible. This is an unsupported recovery workaround, so the app should ideally reconcile a missing rollout and allow archive/remove without requiring the original rollout file.
This still occurs on Windows with the OpenAI.Codex desktop package version 26.1103.4239.0 (observed on 2026-11-09). The affected chat originated in VS Code and is listed in the desktop sidebar. Selecting Archive shows “聊天归档未成功” (“Failed to archive chat”) and leaves it in the active list.
Read-only inspection of the affected local chat found:
state_5.sqlitestill has the thread row witharchived=0,is_pinned=0, andhistory_mode=paginated.- The recorded
rollout_pathpoints to a JSONL file that is absent. A search by thread ID found no matching rollout in the local Codex data directory. thread_history_1.sqlitestill has turn and item records for the same thread.
The user suspects the file might have been removed during disk-space cleanup. We have no evidence confirming when or how it disappeared or which cleanup tool might have been involved.
Please consider a supported archive or recovery path for this state that preserves the remaining paginated history. If the app cannot complete the archive, an error identifying the missing rollout and explaining the available recovery options would be more actionable than the generic toast.
Possibly the same root cause as #62541 (macOS, same engine family): creating a new chat already issues thread/start, and the first send issues a second thread/start and dispatches the turn into the new thread (277–330 ms after creation). The pre-created thread keeps 0 turns and is missing from thread/list, which would leave exactly the kind of non-resumable, non-archivable reference described here.
Worth checking on the Windows build whether one click+send produces two thread/start calls on the Codex Desktop connection — the engine records them as otel spans in logs_2.sqlite, so it is verifiable without any extra tooling.