Skip to content

Codex Desktop bug report: recent conversation history hidden/stale despite local DB containing threads #21076

Description

@ealdent

What version of the Codex App are you using (From “About Codex” dialog)?

26.429.30905

What subscription do you have?

Pro

What platform is your computer?

Darwin 25.4.0 arm64 arm

What issue are you seeing?

Codex Desktop appears to show a stale or incorrectly filtered conversation sidebar after recent CLI/extension/app history imports. Recent conversations exist in the local Codex state database and are returned by the app-server thread/list API, but the Desktop UI does not show them. Manual repairs to global/sidebar state are overwritten on app startup.

The issue appears related to the Desktop "Imported agent setup" flow. I clicked the "Import again" button multiple times. The visible badge count decreased from 16 to 0, and the card reported "Last imported 16h ago", but the sidebar remained stale after repeated imports and after restarting the app.

Impact: I experience this as lost conversation history. Multiple recent project conversations are missing from the visible sidebar, especially recent Mother OS and BlueChimp work. The sidebar appears to show conversations up to roughly 14-16 hours ago, then jumps to much older history, despite the database containing many conversations in between.

Environment:

  • Product: Codex Desktop app on macOS
  • Platform: Darwin 25.4.0 arm64 arm
  • Observed app version from process metadata: 26.429.30905
  • Electron version from process metadata: 41.2.0
  • Local Codex state database: ~/.codex/state_5.sqlite
  • Global UI state file: ~/.codex/.codex-global-state.json
  • Global UI state backup file: ~/.codex/.codex-global-state.json.bak

Evidence:

  • Local DB contains the missing recent conversations with archived = 0.
  • A direct app-server thread/list request with limit: 30, sortKey: "updated_at", sortDirection: "desc", archived: false, and useStateDbOnly: true returned the expected recent list, including the missing Mother OS and BlueChimp conversations.
  • This suggests the database and app-server listing path are correct, while the Desktop sidebar display/state path is stale or filtered incorrectly.

Current hypothesis:
Codex Desktop startup or sidebar state reconciliation is restoring stale selected-remote-host-id and active-workspace-roots from app memory, migration logic, or another source of truth even after both global state files are repaired. This stale active project/remote state appears to affect the visible conversation list, while the underlying DB and app-server recent conversation API remain correct.

What steps can reproduce the bug?

  1. Click the Desktop "Imported agent setup" / "Import again" action multiple times.
  2. Observe the import badge count decrease from 16 to 0, suggesting the importer believes it processed the pending items.
  3. Restart Codex Desktop.
  4. Observe that the sidebar still shows stale history with recent conversations missing.
  5. Inspect ~/.codex/state_5.sqlite and confirm the missing threads exist and are not archived.
  6. Run PRAGMA integrity_check; it returns ok.
  7. Query app-server thread/list with state DB only and confirm the missing conversations are returned.
  8. Inspect global UI state and observe stale state similar to:
{
  "selected-remote-host-id": "[redacted remote host id]",
  "active-workspace-roots": ["[redacted stale workspace root]"],
  "electron-persisted-atom-state": {
    "sidebar-workspace-filter-v2": "all",
    "sidebar-organize-mode-v1": "recent",
    "sidebar-keep-projects-in-recent-v1": false
  }
}
  1. Edit ~/.codex/.codex-global-state.json while Codex is running; the app overwrites the edit.
  2. Fully quit Codex and repair both ~/.codex/.codex-global-state.json and ~/.codex/.codex-global-state.json.bak to clear selected-remote-host-id and active-workspace-roots.
  3. Reopen Codex.
  4. Observe that Codex rewrites selected-remote-host-id and active-workspace-roots back to stale values on startup, and the sidebar remains wrong.

What is the expected behavior?

The Desktop sidebar Recent view should show all unarchived recent conversations sorted by updated_at, including recent conversations across projects such as Mother OS and BlueChimp.

Repeated use of "Imported agent setup" / "Import again" should not cause visible conversation history to disappear, become stale, or be filtered by an old project/remote workspace state.

If local thread/session data exists in ~/.codex/state_5.sqlite and is returned by app-server thread/list, the Desktop sidebar should surface it correctly.

Additional information

Possible areas to inspect:

  • Startup reconciliation of selected-remote-host-id
  • Startup reconciliation of active-workspace-roots
  • Interaction between Recent sidebar mode and active workspace/project selection
  • Import/reindex behavior behind the "Imported agent setup" / "Import again" flow, especially repeated imports where the pending badge count decreases to zero but sidebar state remains stale
  • Any fallback/restore behavior involving .codex-global-state.json.bak
  • Remote project migration logic that may select the first saved workspace root when active roots are empty

Related public reports:

This is high impact because the user perceives recent local work as lost, even though the underlying history is present. The app should either avoid applying stale workspace filters to Recent history, or surface/clear the active filter clearly, and should not silently overwrite repaired state with stale project/remote selection on startup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingsessionIssues involving session (thread) management, resuming, forking, naming, archiving

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions