Failed to start when old sessions are inaccessible

Resolved 💬 1 comment Opened Nov 25, 2025 by sluongng Closed Nov 27, 2025

What version of Codex is running?

0.63.0

What subscription do you have?

plus

Which model were you using?

_No response_

What platform is your computer?

_No response_

What issue are you seeing?

> codex
internal error; agent loop died unexpectedly
                                            

What steps can reproduce the bug?

After several minutes of debugging, it seems like my $HOME/.codex/sessions has some sessions that were run as root with

> sudo -i
> HOME=/home/<old-user> codex

which causes the session files to be under root ownership.

Using sudo chown -R <old-user> $HOME/.codex/ fixed it.

What is the expected behavior?

A better error message indicating the reason for failure would be nice.

Additional information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗