Session lost after battery shutdown + update — no rollout persisted for resumable session
What version of the Codex App are you using (From “About Codex” dialog)?
codex-cli 0.122.0
What subscription do you have?
ChatGPT Plus (monthly subscription)
What platform is your computer?
Linux Mint 21.3 (kernel 5.15.0-174-generic, x86_64)
What issue are you seeing?
A long-running Codex CLI session was lost and cannot be resumed after a normal system shutdown (battery depletion) followed by a Codex update.
The session had already reached the usage/query limit and stopped accepting input, so it should have been in a stable terminal state.
After restarting the system and updating Codex (as prompted), the session is no longer available via codex resume.
No session rollout exists for that day under ~/.codex/sessions.
What steps can reproduce the bug?
- Start a long Codex CLI session
- Work until the usage/query limit is reached
- Leave the machine running on battery
- System performs normal shutdown due to low battery
- Restart the machine
- Launch Codex and attempt to resume session
- Codex prompts for update → perform update
- Attempt to resume again
What is the expected behavior?
A session that has reached a terminal state (such as usage/query limit) should be persisted to disk and recoverable via codex resume after restart.
Additional information
Diagnostics:
- ~/.codex/sessions contains only:
- 2026/04/14
- 2026/04/19
- No directory exists for 2026/04/22
- ~/.codex/history.jsonl was updated on 2026-04-22 (activity confirmed)
- ~/.codex/state_5.sqlite exists but is reused from previous sessions
- No rollout .jsonl file exists for the lost session
System shutdown was clean (battery threshold triggered OS shutdown).
In previous similar situations, codex resume worked correctly after restart.
This suggests that the session was never flushed to disk in a resumable form.
Impact:
Several hours of work lost with no recovery path.
This behavior makes Codex unreliable for long-running sessions unless external logging is used.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗