codex - 💡(How to fix) Fix Codex Desktop bug report: recent conversation history hidden/stale despite local DB containing threads [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#21076Fetched 2026-05-05 05:53:48
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2cross-referenced ×2

Root Cause

Related public reports:

  • https://github.com/openai/codex/issues/18364 - Mac app hides older local conversations after update because bogus root-level status sessions flood recent local history. Very relevant because it mentions state_5.sqlite, local data not deleted, recent local history being displaced, and DB-only repairs not surviving relaunch.
  • https://github.com/openai/codex/issues/17354 - Recent thread history wiped in app, present in CLI. Very relevant symptom match: GUI history wrong while CLI/local state is correct.
  • https://github.com/openai/codex/issues/14389 - Codex Desktop App does not display existing local sessions from shared CODEX_HOME. Similar Desktop sidebar/history enumeration issue where SQLite and disk data exist but older sessions do not show.
  • https://github.com/openai/codex/issues/15368 - Increase cap of sessions in VS Code extension. Relevant to the hidden recent-conversation cap theory; report calls out RECENT_CONVERSATIONS_PAGE_SIZE = 50 and suggests auto-pagination/load-more.
  • https://github.com/openai/codex/issues/10547 - Desktop app stuck in cloud-only mode; local sessions ignored even with codexCloudAccess=disabled. Older closed issue involving Desktop ignoring local sessions and persisted active-workspace-roots.
  • https://github.com/openai/codex/issues/15448 - Codex App hides existing threads when a project is reopened via a symlinked workspace path on macOS. Related path/workspace identity case where data exists but project history is hidden.

Code Example

{
  "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
  }
}
RAW_BUFFERClick to expand / collapse

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:

  • https://github.com/openai/codex/issues/18364 - Mac app hides older local conversations after update because bogus root-level status sessions flood recent local history. Very relevant because it mentions state_5.sqlite, local data not deleted, recent local history being displaced, and DB-only repairs not surviving relaunch.
  • https://github.com/openai/codex/issues/17354 - Recent thread history wiped in app, present in CLI. Very relevant symptom match: GUI history wrong while CLI/local state is correct.
  • https://github.com/openai/codex/issues/14389 - Codex Desktop App does not display existing local sessions from shared CODEX_HOME. Similar Desktop sidebar/history enumeration issue where SQLite and disk data exist but older sessions do not show.
  • https://github.com/openai/codex/issues/15368 - Increase cap of sessions in VS Code extension. Relevant to the hidden recent-conversation cap theory; report calls out RECENT_CONVERSATIONS_PAGE_SIZE = 50 and suggests auto-pagination/load-more.
  • https://github.com/openai/codex/issues/10547 - Desktop app stuck in cloud-only mode; local sessions ignored even with codexCloudAccess=disabled. Older closed issue involving Desktop ignoring local sessions and persisted active-workspace-roots.
  • https://github.com/openai/codex/issues/15448 - Codex App hides existing threads when a project is reopened via a symlinked workspace path on macOS. Related path/workspace identity case where data exists but project history is hidden.

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.

extent analysis

TL;DR

The most likely fix involves modifying the Codex Desktop app's startup logic to prevent it from overwriting repaired global UI state with stale selected-remote-host-id and active-workspace-roots values.

Guidance

  1. Inspect startup reconciliation logic: Review the code responsible for reconciling selected-remote-host-id and active-workspace-roots during startup to ensure it doesn't restore stale values.
  2. Verify global UI state handling: Confirm that the app correctly handles edits to ~/.codex/.codex-global-state.json and doesn't overwrite them with stale data on startup.
  3. Investigate import/reindex behavior: Examine the "Imported agent setup" / "Import again" flow to determine why repeated imports cause the sidebar state to remain stale.
  4. Check for fallback/restore behavior: Look into any fallback or restore mechanisms involving .codex-global-state.json.bak that might be contributing to the issue.
  5. Test with modified global state: Manually edit ~/.codex/.codex-global-state.json to clear selected-remote-host-id and active-workspace-roots, then restart the app to see if the sidebar correctly displays recent conversations.

Example

No code snippet is provided as the issue doesn't specify exact code changes, but the investigation should focus on the startup logic and global UI state handling.

Notes

The issue may be related to the app's handling of global UI state and startup reconciliation. Further investigation is needed to determine the root cause and develop a comprehensive fix.

Recommendation

Apply a workaround by manually editing ~/.codex/.codex-global-state.json to clear selected-remote-host-id and active-workspace-roots before restarting the app, as this may temporarily resolve the issue until a permanent fix is implemented.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Codex Desktop bug report: recent conversation history hidden/stale despite local DB containing threads [2 comments, 2 participants]