Desktop sidebar: invalid persisted `flat-project-sidebar-preferences-v1.mode` value crashes the app on startup
Open 💬 0 comments Opened Aug 6, 2026 by Glenn0331
Environment
- Codex Desktop (app version 26.730.61639, core
codex0.147.0-alpha.1.2) - Windows 11
- Authentication: API-key login (
forced_login_method = "api",preferred_auth_method = "apikey")
Summary
The desktop UI stores sidebar view preferences in .codex-global-state.json underelectron-persisted-atom-state.flat-project-sidebar-preferences-v1.mode. Writing any value
outside the valid enum makes the app show a fatal error page ("糟糕,出错了" / "Something went
wrong") at startup, leaving the app unusable until the file is manually repaired.
From the app bundle, the only accepted values for mode are "project" and "list".
Steps to reproduce
- Fully quit Codex.
- Edit
C:\Users\<user>\.codex\.codex-global-state.jsonand set
electron-persisted-atom-state.flat-project-sidebar-preferences-v1.mode to "chats".
- Launch Codex. The UI fails to start and shows a generic error page.
Expected behavior
Invalid persisted values should be validated and ignored with a graceful fallback to the
default, instead of crashing the UI.
Suggested fix
- Validate settings against their schema on load and fall back to the default on invalid values.
- Prefer an in-app settings toggle for the sidebar view mode instead of undocumented JSON keys.
Impact
The app can become nearly unusable through a single bad config value, and recovery requires
manual editing of a state file.