Codex update unexpectedly archives or hides recent local threads

Open 💬 1 comment Opened Jun 26, 2026 by greenTableWork

Summary

After updating Codex, recent existing threads on my machine were hidden from the thread list / appeared archived, even though the rollout files still existed locally. Restoring the rows in the local Codex state DB made the threads reappear, so this looks like update-time metadata drift rather than intentional user archival or data loss.

Environment

  • Product: Codex desktop app / local thread state
  • Host: macOS local host (mac-mini)
  • Local state files involved:
  • ~/.codex/state_5.sqlite
  • ~/.codex/session_index.jsonl
  • ~/.codex/sessions/...
  • ~/.codex/archived_sessions/...
  • Date observed/restored: 2026-06-25 America/Los_Angeles

What I observed

  • Recent rollout files still existed on disk, but several were under ~/.codex/archived_sessions.
  • The threads table had archived=1 and non-null archived_at for recent threads that I did not intentionally archive.
  • The app thread list did not show some of these recent threads until the archive metadata was cleared.

Example affected rows before repair included:

019efa7a-8f2c-72e1-a96b-a63e53fe2cce  Locate waiting thread                     updated 2026-06-24 16:36:26  archived=1
019ef03e-ca33-7f21-95a8-628f13c5f9c7  List backtest data needs                  updated 2026-06-24 07:36:09  archived=1
019ef86e-95c4-7590-854a-c107a84e1a46  Wait for thread completion                updated 2026-06-24 07:05:54  archived=1
019ef7f4-ca4f-7221-8b86-5acb07daf1ba  Verify missing data scrapes               updated 2026-06-24 04:51:41  archived=1
019ef28c-d988-7430-95c6-a63acb2c6b5d  Find days with >4.5% gains                updated 2026-06-23 20:03:22  archived=1

Manual repair that worked

I backed up ~/.codex/state_5.sqlite and ~/.codex/session_index.jsonl, then for recent archived rows:

  1. Moved rollout files from ~/.codex/archived_sessions/rollout-...jsonl back to the canonical ~/.codex/sessions/YYYY/MM/DD/rollout-...jsonl path.
  2. Updated the matching threads rows to set archived=0, archived_at=NULL, and rollout_path=<canonical sessions path>.
  3. Re-ran the app thread listing; the restored threads appeared again.

Expected behavior

Updating Codex should preserve existing local thread visibility/archive state. Threads should only be archived when the user explicitly archives them or when a documented retention/archive policy intentionally applies.

Actual behavior

After update, recent threads were marked archived/hidden locally despite their session data still being present.

Why this seems like a bug

The data was recoverable and the app recognized the threads again after clearing archive metadata and restoring canonical rollout paths. This suggests the update path, migration, index rebuild, host reconciliation, or archival routine may be incorrectly marking recent threads as archived or moving rollout files to archived_sessions.

Suggested checks

  • Audit update/migration code paths that rewrite threads.archived, threads.archived_at, or threads.rollout_path.
  • Verify host-qualified thread reconciliation does not archive local/remote duplicates unexpectedly.
  • Ensure archive state is not inferred solely from file location when rebuilding state_5.sqlite.
  • Consider a repair/reindex command that can rebuild visible thread metadata from session_index.jsonl and sessions/ without silently archiving recent user threads.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗