Problem
Older Codex versions persisted renamed thread names in session_index.jsonl, while newer native surfaces also read threads.name from state_5.sqlite. After provider/relay changes, those legacy sessions remain resumable but their renamed titles can be absent in Codex CLI or Codex for VS Code.
Proposed behavior
On CC-Switch startup, perform a safe one-time backfill for each applicable Codex state database:
- fill only blank/null
threads.name values from matching session_index.jsonl entries;
- never overwrite a current non-empty name;
- preserve archive status and all unrelated fields;
- cover the default Codex DB and configured
sqlite_home;
- take a SQLite backup and use a crash-consistent per-DB migration ledger;
- protect against concurrent writers/source changes and bound startup work.
I have an implementation with focused race, rollback, replacement-DB, archive, malformed-input, size-limit, and sqlite_home tests and will open the PR after this issue as requested by the contribution guide.
Problem
Older Codex versions persisted renamed thread names in
session_index.jsonl, while newer native surfaces also readthreads.namefromstate_5.sqlite. After provider/relay changes, those legacy sessions remain resumable but their renamed titles can be absent in Codex CLI or Codex for VS Code.Proposed behavior
On CC-Switch startup, perform a safe one-time backfill for each applicable Codex state database:
threads.namevalues from matchingsession_index.jsonlentries;sqlite_home;I have an implementation with focused race, rollback, replacement-DB, archive, malformed-input, size-limit, and
sqlite_hometests and will open the PR after this issue as requested by the contribution guide.