openai / openai/codex

Windows Desktop: conversations disappear from UI even though JSONL sessions still exist; add first-party recovery/reindex tool

Open
#40,779 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

app enhancement session windows-os
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

Summary

On Windows, Codex/ChatGPT Desktop can lose visibility of existing conversations even though the underlying local session files still exist on disk as JSONL files under ~/.codex/sessions.

This has happened more than once on the same machine. The conversations appear to be lost from the UI/sidebar, but the JSONL session files are still present locally. In other words, this looks like a local indexing/state/sidebar hydration failure rather than actual data deletion.

Because this failure mode is recurring and highly disruptive, the Desktop app should provide a first-party conversation recovery / reindex capability that can scan the persisted JSONL session files and rebuild the UI-visible conversation index/state.

Environment
  • Platform: Windows x64
  • Codex Desktop package observed during the latest incident: OpenAI.Codex 26.820.7780.0
  • ChatGPT Desktop also installed on the same machine
  • Local session storage: %USERPROFILE%\.codex\sessions
  • User has previously observed conversations disappear from the Desktop UI while the corresponding .jsonl files remain on disk
What issue are you seeing?

After an app update/startup failure/recovery cycle, conversations that previously existed no longer appear in the Desktop sidebar/history.

The important part is that the underlying files are still present under the local Codex session directory. The data is therefore not necessarily deleted; the Desktop UI simply stops loading/indexing it.

This is especially concerning because the UI gives the impression that the conversations have been permanently lost.

This is not the first time this has happened on this machine.

Expected behavior

If valid local session JSONL files exist, the Desktop app should be able to discover and restore them into the conversation list automatically.

At minimum, the app should provide an explicit recovery action such as:

  • Recover conversations
  • Rebuild conversation index
  • Rescan local sessions

The recovery flow should:

  1. Scan %USERPROFILE%\.codex\sessions and archived_sessions.
  2. Validate readable rollout/session JSONL files.
  3. Reconstruct missing thread metadata where possible.
  4. Rebuild or repair session_index.jsonl / local SQLite/index state used by Desktop.
  5. Restore valid non-archived conversations to the sidebar/history.
  6. Report how many conversations were found, recovered, skipped, or corrupted.
  7. Never overwrite or delete the original JSONL files during recovery.
Why this matters

For long-running software projects, conversations contain implementation context, architectural decisions, debugging history, commands, and reasoning that may span weeks or months.

When the Desktop sidebar suddenly becomes empty or incomplete, users naturally assume their work history has been deleted. If the JSONL source files are still intact, the application should not require users to manually inspect SQLite, edit local state files, identify thread IDs, or reverse engineer internal indexes to recover their own conversations.

A supported recovery function would make the app significantly more resilient to:

  • failed migrations
  • app updates
  • stale/corrupt local indexes
  • sidebar/index desynchronization
  • local database rebuilds
  • reinstall/recovery scenarios
Suggested UX

A recovery option could be exposed under something like:

Settings -> Data / Troubleshooting -> Recover local conversations

Before making changes, it could create a backup of local metadata/index databases, then rebuild derived state from the persisted session JSONL files.

It would also be useful to expose a CLI equivalent, for example conceptually:

codex sessions repair
codex sessions reindex
Related issues

This appears related to an existing family of reports where threads remain on disk but disappear from Desktop/sidebar/search, including:

  • #17540 - Windows app: older local threads disappear from sidebar and sidebar search after restart while still present on disk
  • #20833 - Desktop project sidebar hides older workspace conversations despite existing local thread data
  • #21128 - Desktop silently hides project conversations outside the recent window
  • #23979 - local project conversation history missing after update while local data still exists
  • #26236 - chat history disappeared from sidebar after app update
  • #27159 - active local threads hidden from sidebar/search while local state remains intact
  • #30385 - local project threads missing from sidebar/search although session index and direct reads work

Those issues mainly describe visibility/indexing failures. This report specifically asks for a supported, user-facing recovery/reindex mechanism so users can restore conversations from the authoritative local JSONL session files when this class of failure occurs again.

Additional information

The same Windows machine recently experienced a separate startup regression in 26.820.7780.0 where the app could not locate/execute the bundled Codex CLI. After recovering the application, the broader concern remains that local conversation history can become detached from the UI even though the JSONL files still exist.

The session JSONL files can contain private source code, prompts, local paths, and other sensitive project information, so a recovery mechanism should operate locally and should not require uploading the raw session files to support or GitHub.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the local %USERPROFILE%\.codex\sessions and archived_sessions JSONL files, then inspect how session_index.jsonl and local SQLite/index state represent conversations. The requested result is a user-facing recovery or reindex flow that preserves source files, reports recovered or skipped sessions, and restores valid conversations to the Desktop sidebar.

Written by the indexing model from the issue text.

Assessment

Tech stack
json, rust, sqlite
Domain
cli, databases, desktop, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.