Desktop: launch crash ("Something went wrong") caused by a persisted composer @-mention draft — at-mention-list TypeError reading 'match'
Environment
- Codex App version: 26.616.51431 (build 4212)
- Platform: macOS 26.5.1 —
Darwin 25.5.0 arm64 arm - Subscription: ChatGPT Pro
What happens
On launch, Codex Desktop immediately shows the full-screen "Something went wrong" / "糟糕,出错了" error and is completely unusable — clicking Retry just throws again. It started right after the app auto-updated to 26.616.51431, so this is a regression (the previous version was fine).
How to reproduce
- In the composer (the message box of a new conversation), type
@followed by a letter — e.g.@r— to start an @-mention. Don't pick anything from the popup and don't send the message; just leave@rsitting in the box. - Quit Codex while that unsent text is still in the composer.
- Reopen Codex.
➡️ It comes straight up to the "Something went wrong" screen and never loads the UI.
In short: any half-typed @-mention left in the composer when you quit will brick the app on the next launch.
Screenshot
<img width="1100" height="500" alt="Image" src="https://github.com/user-attachments/assets/a1f95f29-59b4-48da-9fa8-651fe56a2956" />
Workaround
Since the app won't open, you can't clear it from the UI. Quit Codex, then in ~/.codex/.codex-global-state.json set electron-persisted-atom-state.composer-prompt-drafts-v1 to {} (that's where the unsent composer draft is stored — mine held {"new-conversation":"@r"}). Back up the file first, then relaunch.
Technical details (for maintainers)
Renderer error, caught by the top-level AppRoutes error boundary:
TypeError: Cannot read properties of undefined (reading 'match')
React component stack (leaf first): at-mention-list → composer-top-menu-chrome → composer. On launch the saved draft is restored, the @-mention list re-renders for that query, and something on that code path calls .match() on an undefined value — which throws through the top-level error boundary and takes down the whole app.
Notes:
- Reproduces with a clean
--user-data-dir, so it isn't Chromium profile/cache corruption. - Independent of remote SSH hosts (crashes whether or not a remote connects).
- An
@rdraft in an otherwise-emptyCODEX_HOMEdoesn't crash on its own — it needs normal workspace/session data present so the @-mention list has items to render.
Expected behavior
A leftover/partial @-mention draft should render normally (or simply be ignored). It must never throw through the top-level error boundary and make the entire app unlaunchable — the @-mention list should guard the undefined value instead of calling .match() on it.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗