Skip to content

Codex Desktop sidebar loses chat history when thread titles contain large transcript chunks #21119

Open

Description

@ywkuno

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.

Activity

  1. added
    bugSomething isn't working
    appIssues related to the Codex desktop app
    windows-osIssues related to Codex on Windows systems
    sessionIssues involving session (thread) management, resuming, forking, naming, archiving
    on May 5, 2026
  2. Donkodio commented on May 31, 2026

    @Donkodio

    I hit a very similar Codex Desktop sidebar/indexing failure on macOS.

    In my case, project pages showed "No chats", but local data still existed in ~/.codex/state_5.sqlite and SQLite integrity was OK. The key clue was that pinned chats were still visible, which suggested this was not data loss but a sidebar/project index problem.

    The practical workaround was:

    • rebuild thread-workspace-root-hints from the local threads.cwd data;
    • rebuild sidebar project/chat ordering;
    • use pinned-thread-ids as a visibility fallback;
    • archive service automation/subagent threads to reduce sidebar noise.

    I published a sanitized unofficial helper here:
    https://github.com/Donkodio/codex-desktop-sidebar-recovery

    It does not upload data and defaults to dry-run. I am not sharing raw session files, tokens, .env files, private keys, Telegram sessions, proxy credentials, or private chat dumps.

  3. grnbtqdbyx-create commented on May 31, 2026

    @grnbtqdbyx-create
  4. roccodaffuso commented on Jun 4, 2026

    @roccodaffuso

    My local instance is currently working again, so I am not asking for recovery help. I am adding redacted diagnostics because this previously reproduced on my machine and seems relevant to the broader sidebar/project discovery bug.
    I am seeing the same class of Codex Desktop sidebar/project history issue on macOS.

    The important detail is that local data does not appear to be lost. Existing conversations and rollout files are still present locally, but the Desktop sidebar/project view can show "No chats" or hide valid project conversations.

    Local diagnostics, redacted:

    • OS: macOS 26.3.1, build 25D2128
    • Codex Desktop bundle id: com.openai.codex
    • Codex Desktop version: 26.601.21317
    • Codex Desktop build: 3511
    • Local DB: ~/.codex/state_5.sqlite
    • SQLite PRAGMA integrity_check: ok
    • Total threads in threads: 224
    • Active/unarchived threads: 67
    • Session rollout JSONL files found locally: 224
    • Threads with length(title) > 200: 162
    • Threads with length(title) > 1000: 155
    • Max observed length(title): 5852

    In my case, this issue was also likely amplified by recurring/heartbeat automation threads:

    • A recurring automation previously spawned standalone review/service threads.
    • Project chats became difficult to discover in the sidebar even though the underlying local data remained present.
    • I paused the recurring automation and moved the workflow to a single persistent runner thread to reduce sidebar/thread volume.
    • Current local automation state: the standalone cron automation is paused, while one heartbeat runner thread remains active.

    This looks like a sidebar/project discovery/indexing bug rather than data loss. It may overlap with the oversized-title metadata issue, but the automation/service-thread angle also matters because it can greatly increase thread volume and make the UI state drift more visible.

    Suggested fixes:

    • Project expansion should query all local unarchived threads for that workspace root, not rely only on the global recent thread list.
    • The UI should not show "No chats" if local thread/list for that cwd returns rows.
    • Service/automation/heartbeat threads should be separately classified, collapsed, or hidden from normal project chat ordering.
    • threads.title and first_user_message metadata should be capped/sanitized before persistence.
    • Sidebar rendering should defensively truncate display fields and avoid silently dropping rows when metadata is large.
    • Codex Desktop should provide a safe "repair/rebuild local chat index" action.

    I am intentionally not attaching raw DB rows, logs, or session files because they contain private conversation/project data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingsessionIssues involving session (thread) management, resuming, forking, naming, archivingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions