codex - 💡(How to fix) Fix Codex Desktop sidebar loses chat history when thread titles contain large transcript chunks [1 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#21119Fetched 2026-05-05 05:53:20
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
1
Author
Timeline (top)
labeled ×4commented ×1cross-referenced ×1

Error Message

  • Sidebar Chats section only shows one recent thread.
  • Existing chats are still discoverable via Search.
  • Pinning a found chat restores it under Pinned.
  • SQLite integrity check passes and session files are still present.

Root Cause

I have not attached raw DB rows because they include private chat/project contents.

Fix Action

Workaround

Closing Codex, backing up %USERPROFILE%\.codex\state_5.sqlite*, then truncating oversized threads.title / first_user_message metadata should restore sidebar list behavior without deleting session JSONL history.

I have not attached raw DB rows because they include private chat/project contents.

Code Example

DB: %USERPROFILE%\.codex\state_5.sqlite
PRAGMA integrity_check: ok
threads total: 125
active threads: 110
archived threads: 15
session JSONL files on disk: 121

---

active threads where length(title) > 200: 62
active threads where length(title) > 1000: 56
active threads where length(title) > 10000: 21
max length(title): 79452
avg length(title): 8732.992

---

id: <thread-id>
title_len: 79452
title_preview: "<normal user opening text> [165] user: # In app browser: ..."

---

method=thread/list ... errorCode=null ... durationMs=186
RAW_BUFFERClick to expand / collapse

What is the issue?

Codex Desktop suddenly stopped showing most chat history in the left sidebar. The chats are still recoverable through Search, and pinning a searched chat makes it appear again, so this does not appear to be data loss. It looks like the sidebar thread list rendering/query path fails or drops most items while search still indexes them.

Environment

  • OS: Windows
  • Codex Desktop package: OpenAI.Codex
  • Codex Desktop version: 26.429.3425.0
  • Store package family: OpenAI.Codex_2p2nqsd0c76g0

Observed behavior

  • Sidebar Chats section only shows one recent thread.
  • Existing chats are still discoverable via Search.
  • Pinning a found chat restores it under Pinned.
  • SQLite integrity check passes and session files are still present.

Local diagnostics

The local thread store appears healthy:

DB: %USERPROFILE%\.codex\state_5.sqlite
PRAGMA integrity_check: ok
threads total: 125
active threads: 110
archived threads: 15
session JSONL files on disk: 121

However, many threads.title and threads.first_user_message values are extremely large. These look like transcript chunks rather than sidebar-safe titles.

active threads where length(title) > 200: 62
active threads where length(title) > 1000: 56
active threads where length(title) > 10000: 21
max length(title): 79452
avg length(title): 8732.992

Example shape, redacted:

id: <thread-id>
title_len: 79452
title_preview: "<normal user opening text> [165] user: # In app browser: ..."

The global state still has pinned thread IDs in %USERPROFILE%\.codex\.codex-global-state.json under electron-persisted-atom-state.pinned-thread-ids.

Relevant logs

Startup logs show thread/list returning successfully, which matches search/history still existing:

method=thread/list ... errorCode=null ... durationMs=186

There are also slow startup/config/plugin calls around ~60 seconds and many Git probe warnings, but the key sidebar-specific clue seems to be the huge thread metadata.

Hypothesis

threads.title / first_user_message can become populated with large transcript/browser/comment/approval-history payloads. The search path can still find threads, but the sidebar list renderer or thread/list consumer appears to fail, truncate incorrectly, or silently omit most rows when many active threads have very large titles.

Workaround

Closing Codex, backing up %USERPROFILE%\.codex\state_5.sqlite*, then truncating oversized threads.title / first_user_message metadata should restore sidebar list behavior without deleting session JSONL history.

I have not attached raw DB rows because they include private chat/project contents.

Expected behavior

The sidebar should continue listing active chats even if title generation or first-message metadata becomes very large. Ideally titles should be capped/sanitized before persistence, and thread/list/sidebar rendering should defensively truncate display fields.

extent analysis

TL;DR

Truncating oversized threads.title and first_user_message metadata in the SQLite database may restore the sidebar list behavior in Codex Desktop.

Guidance

  • Verify that the issue is caused by large metadata by checking the length of threads.title and first_user_message in the SQLite database.
  • Truncate oversized metadata by running a SQL query to update the threads table, such as UPDATE threads SET title = SUBSTR(title, 1, 200) WHERE LENGTH(title) > 200.
  • Backup the SQLite database before making any changes to ensure data safety.
  • Consider implementing a defensive truncation mechanism in the thread/list consumer or sidebar list renderer to prevent similar issues in the future.

Example

UPDATE threads
SET title = SUBSTR(title, 1, 200)
WHERE LENGTH(title) > 200;

This query truncates the title field to 200 characters for rows where the length exceeds 200.

Notes

This workaround may not address the root cause of the issue, which is the population of large transcript/browser/comment/approval-history payloads in the threads.title and first_user_message fields. A more permanent solution would involve modifying the title generation or metadata persistence logic to cap or sanitize the data.

Recommendation

Apply the workaround by truncating oversized metadata, as it is a relatively safe and straightforward solution that can restore the sidebar list behavior without deleting session JSONL history.

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…

FAQ

Expected behavior

The sidebar should continue listing active chats even if title generation or first-message metadata becomes very large. Ideally titles should be capped/sanitized before persistence, and thread/list/sidebar rendering should defensively truncate display fields.

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 sidebar loses chat history when thread titles contain large transcript chunks [1 comments, 2 participants]