Skip to content

Archived chats page is empty even though archived threads exist in state_5.sqlite #30312

Open

Description

@xulong-jia

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

26.616.71553

What subscription do you have?

ChatGPT Pro

What platform is your computer?

Darwin 25.5.0 arm64 arm

What issue are you seeing?

Summary

In Codex Desktop, the Archived Chats page shows "No archived chats", but local state indicates that archived threads still exist.

The data does not appear to be lost. The SQLite database is healthy, archived threads exist, previews are non-empty, and rollout files still exist on disk.

Environment

  • Product: Codex Desktop App
  • Codex App version: 26.616.71553
  • CLI version: codex-cli 0.142.2
  • Platform: macOS
  • State database: ~/.codex/state_5.sqlite

Steps to Reproduce

  1. Open Codex Desktop.
  2. Archive one or more chats.
  3. Go to Settings.
  4. Open the Archived Chats page.
  5. The page shows no archived chats.

Expected Behavior

Archived chats should appear in the Archived Chats page and be available for unarchive or review.

Actual Behavior

The Archived Chats page is empty and shows no archived chats.

Investigation

I inspected the local Codex state database and found that the archived data still exists.

Results:

  • pragma integrity_check returns ok
  • threads table contains archived threads
  • archived=1 thread count: 4
  • archived=1 AND preview<>'' count: 4
  • archived=1 AND preview='' count: 0
  • All archived thread rollout_path files exist
  • ~/.codex/archived_sessions contains archived jsonl files

Archived thread examples:

id title preview length archived rollout_path
019f0170-9346-7330-a867-633956d633bd Archived SmartTraffic audit thread 500 1 exists
019ef8fc-ddf8-7071-ac8d-db163bdf3501 SmartTraffic Stage 5 closing docs/tag thread 2343 1 exists
019ef38d-a3e2-7483-85d9-2e1d8e8d5a77 SmartTraffic Stage 5A thread 3060 1 exists
019ef268-affe-70c2-9b6b-a7593a174dbf SmartTraffic Stage 5B pre-commit review thread 4153 1 exists

Additional Notes

This does not look like data loss or SQLite corruption.

It looks more like the Archived Chats page is using an additional UI filter, stale cache, or query condition that does not match the actual archived thread data in state_5.sqlite.

I previously had another issue where normal history threads were hidden because their preview field was empty. After filling missing previews, normal history became visible again. However, the Archived Chats page is still empty even though archived thread previews are non-empty.

What steps can reproduce the bug?

  1. Open Codex Desktop.
  2. Archive one or more conversations.
  3. Open Settings.
  4. Open the "Archived Chats" page.
  5. The page shows "No archived chats".

However, the local state still contains archived threads.

I verified that:

  • state_5.sqlite is healthy (pragma integrity_check = ok)
  • archived=1 threads still exist
  • archived thread previews are non-empty
  • archived rollout files still exist on disk

What is the expected behavior?

Archived conversations should appear in the Archived Chats page and be available for viewing or restoring.

Additional information

Additional local investigation:

The issue does not appear to be data loss.

Local checks show:

  • state_5.sqlite integrity check: ok
  • archived=1 threads: 4
  • archived=1 AND preview<>'': 4
  • archived=1 AND preview='': 0
  • All archived thread rollout_path files exist
  • ~/.codex/archived_sessions contains archived .jsonl files

This may be related to #28664, but my case specifically affects archived=1 threads and the Archived Chats page.

Image

Activity

  1. added
    appIssues related to the Codex desktop app
    on Jun 26, 2026
  2. added
    bugSomething isn't working
    sessionIssues involving session (thread) management, resuming, forking, naming, archiving
    on Jun 27, 2026
  3. github-actions commented on Jun 27, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  4. Nicolas0315 commented on Jun 27, 2026

    @Nicolas0315

    I traced the repo-owned path for this one. In this checkout I could not find a list-archived-threads or Archived Chats webview implementation; the protocol exposed here is thread/list, with archived and useStateDbOnly parameters.

    What I verified locally on current main (d047c33a1):

    cargo nextest run -p codex-app-server thread_list_archived_filter --no-fail-fast
    # PASS suite::v2::thread_list::thread_list_archived_filter
    
    cargo nextest run -p codex-app-server thread_list_state_db_only_returns_sqlite_without_jsonl_repair --no-fail-fast
    # PASS suite::v2::thread_list::thread_list_state_db_only_returns_sqlite_without_jsonl_repair
    

    The backend code path already routes thread/list with archived: true to the archived listing, and when useStateDbOnly is also true it calls the state-db archived listing path. So I don't currently see a Rust-side data-loss or missing-archive-listing bug in this repo.

    This lines up with #29600's bundle inspection: the Desktop Archived Chats page appears to use a client/webview-side list-archived-threads path that is not present in this repository, and that likely needs the UI-side fix. A useful next check in the Desktop app would be to inspect the actual list-archived-threads response for hostId: local and compare it with what the page passes into its archived-thread renderer.

  5. xulong-jia commented on Jun 27, 2026

    @xulong-jia
    Author
  6. lophura33-wq commented on Sep 2, 2026

    @lophura33-wq

    Windows reproduction after a Codex Desktop update/restart (2026-09-02):

    • Before the update, archived chats belonging to a local project were visible.
    • Immediately after updating and restarting, Settings > Archived Chats showed no archived chats.
    • The local archived_sessions directory still contained 198 readable JSONL rollout files, so the transcripts were not deleted.
    • The app's archived-thread listing returned zero entries.
    • I used the official unarchive operation on one known archived thread. The operation returned success, and its JSONL file was correctly moved from archived_sessions back into the active sessions directory.
    • Despite that successful underlying move, the unarchived thread still did not appear in the project/task list. It could only be opened by navigating directly to its thread ID.
    • The session metadata records bundled CLI version 0.151.0-alpha.7.2.

    This appears to be an update-triggered local thread indexing/sidebar hydration regression rather than data loss or a failure of the archive/unarchive file operation. Both archived discovery and post-unarchive list visibility are affected.

    Project names, thread IDs, conversation contents, and local paths have been omitted.

  7. jsegeren commented on Sep 19, 2026

    @jsegeren

    For anyone blocked while the Desktop archive view is fixed: I maintain an independent Mac tool that reads the supported active and archived local Codex transcript trees directly, so an archived thread can still be found and exported even when the Codex UI says none exist. It also creates client-side encrypted, versioned backups and can recover one missing transcript without replacing unrelated live history.

    It does not repair OpenAI's archived-thread index or claim to fix this UI bug; it gives the surviving local transcripts a separate read-only discovery and recovery path. Source and CLI are MIT licensed: https://github.com/jsegeren/codex-migrate

    Disclosure: I maintain Codex Migrate + Vault. The packaged signed Apple-silicon app is paid; the engine and CLI are free.

  8. ikaros0202 commented on Nov 20, 2026

    @ikaros0202

    I can still reproduce this on Windows 11 x64 (build 26200) with Codex Desktop 26.1117.3838.0 and the bundled codex-cli 0.171.0-alpha.13. This affects local Codex chats, including chats in local projects.

    1. Archive an existing local chat from the sidebar menu. The chat disappears from the active list and the archive operation succeeds.
    2. Open Settings → Archived Chats.
    3. The page is empty. The newly archived chat should appear there and be available to open or restore.

    I ran these checks on November 20, 2026:

    • A read-only check of state_5.sqlite found 64 rows with archived = 1 (37 regular chats and 27 subagent records). SQLite PRAGMA quick_check returned ok.
    • I reproduced the empty result outside the UI using a fresh instance of the bundled app-server over stdio. thread/list with {"archived":true,"limit":5} returned an empty page and no next cursor, without an RPC error. Adding "useStateDbOnly":true gave the same result. The same app-server returned five chats and a next cursor with {"archived":false,"limit":5}.
    • I could read an affected chat by its known ID. Unarchiving that chat by ID succeeded, and I verified that its SQLite row switched to archived = 0.

    Could the team investigate why the local app-server returns an empty archived page while the same installation can read and restore an archived chat by ID? The direct RPC reproduction may help narrow down where the records are being excluded.

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, archiving

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions