[Windows][Desktop] Switching to Beta after the 26.820 Stable startup regression hides all legacy local threads (`chatgpt_http`)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What version of the Codex App are you using?
Affected Stable installation:
- Desktop internal version:
26.820.60940 - Windows MSIX package:
OpenAI.Codex 26.820.7780.0 - Bundled CLI:
codex-cli 0.150.0-alpha.8
Working fallback installation, where the history migration issue occurs:
- Beta MSIX package:
OpenAI.CodexBeta 26.727.4816.0 - Beta app-server/CLI:
0.146.0-alpha.9.2
What platform is your computer?
- Microsoft Windows NT
10.0.26200.8655, x64 - ChatGPT account authentication
What issue are you seeing?
This is a follow-on data-compatibility regression encountered while using Beta as a workaround for #40715.
The complete failure sequence was:
-
Stable updated to
26.820.60940and could no longer start or resume threads because Desktop injected an invalidmcp_servers.codex_apptransport. This matches #40715. -
Beta
26.727.4816.0could start and run threads, so it was used as a temporary fallback against the same sharedCODEX_HOME. -
After opening Beta, every existing local project showed No chats, and only the newly created diagnostic thread appeared under Recent.
-
An older thread title briefly appeared, but opening it failed with:
ChatGPT can't load config.toml, so this thread can't resume. Fix config.toml: Model provider `chatgpt_http` not found. After saving the file, reopen the thread. -
Restoring a valid
model_providers.chatgpt_httpdefinition made old threads readable by ID, but the sidebar still hid them.
This looked like complete history loss, but the underlying conversation data had not been deleted.
Forensic findings
The affected profile contained:
187rows in~/.codex/state_5.sqlite187/187corresponding rollout JSONL files present0missing rollout files0invalid JSONL records187/187rollouts containing genuine user messages20local projects54explicit thread-to-project assignments
Before recovery:
186legacy local thread rows hadmodel_provider = 'chatgpt_http'- The single newly created, visible Beta thread had
model_provider = 'openai' - Direct thread reads by ID succeeded after restoring the provider definition
- The app's actual recent-thread/list path returned only the one
openailocal thread and excluded allchatgpt_httprows, even withmodelProviders: null
The decisive canary test was changing only one backed-up legacy thread's state index from chatgpt_http to openai. That exact thread immediately appeared in the real Desktop thread-list response and its existing content remained readable. Migrating the remaining legacy state/catalog provider indexes restored the complete local history.
Two additional backward-compatibility gaps were observed during recovery:
- All legacy state rows had
has_user_event = 0even though every rollout contained real user messages. - Existing project assignment objects did not contain the newer required
pendingCoreUpdateboolean, so the Beta renderer ignored the old assignments until that field was added withfalse.
These two corrections alone did not restore the sidebar. The final blocker was the legacy chatgpt_http provider value being excluded by the current list path.
Steps to reproduce
This requires an existing Windows profile with local threads created under the older provider identifier.
- Have existing local Codex Desktop threads whose state rows use
model_provider = 'chatgpt_http'. - Update Stable to the affected
26.820.xbuild and encounter #40715. - Install/open Beta
26.727.4816.0against the same sharedCODEX_HOME. - Create one new Beta thread.
- Restart Beta.
- Observe that the new
openaithread is visible, while old projects display No chats and old local history is absent from Recent. - Read an old thread directly by ID: its rollout and content still exist.
- Change one backed-up legacy thread index from
chatgpt_httptoopenaiand query the app's thread list again. - Observe that the canary thread now appears.
What is the expected behavior?
- Switching between supported Stable and Beta builds must not make intact local history appear deleted.
- Legacy provider identifiers should be migrated or treated as compatible aliases when the state database is opened.
- Missing newer fields in persisted UI/project state should receive backward-compatible defaults.
- If a thread cannot be listed or resumed, Desktop should surface an actionable compatibility error instead of silently showing No chats.
- Updating one app channel should not leave the shared
CODEX_HOMEin a state that the other channel cannot understand.
Recovery notes for affected users
The safest first response is:
- Do not clear application data, uninstall with data removal, or delete
~/.codex. - Fully exit Desktop.
- Back up
config.toml,.codex-global-state.json,state_5.sqlite,sqlite/codex-dev.db, and thesessionsdirectory. - Verify that rollout JSONL files still exist before concluding that history is lost.
On this installation, recovery required migrating internal provider/catalog metadata and rebuilding visibility/project metadata from verified rollout files. This is an unsupported internal repair and should not be presented as a general-purpose SQL recipe without backups and validation. An official repair/migration command would be much safer.
Requested fix
- Fix the Stable
mcp_servers.codex_appregression tracked in #40715. - Add a state migration from legacy
chatgpt_httpthread/catalog rows to the currently supported provider identifier, or preservechatgpt_httpas a readable alias. - Recompute
has_user_eventfrom valid rollout events when importing legacy state. - Default missing
pendingCoreUpdatevalues tofalsewhen parsing older project assignments. - Add a supported history-repair command that validates rollouts, backs up state, and rebuilds local indexes without deleting conversation data.
- Add a regression test where Stable and Beta sequentially open the same populated
CODEX_HOME.
Additional information
- Database integrity checks passed after recovery.
- No rollout/session files were deleted or regenerated.
- The full recovery restored all
187local threads and all54project assignments. - Screenshots from before and after recovery are available if maintainers need them.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the state_5.sqlite and sqlite/codex-dev.db data alongside the sessions rollout JSONL files, then trace the Desktop thread-list path and persisted project-assignment parsing. Done means supported Stable and Beta builds preserve legacy local history, apply compatible defaults and provider migration, surface actionable errors, and include a regression test for shared CODEX_HOME.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, sqlite
- Domain
- databases, desktop, operating-systems, testing-qa
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100