[WSL] Resumed sessions get a lowercased /mnt cwd from the state DB, breaking project trust and approval matching
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- PR merge metrics
- PR metrics pending
Description
What version of Codex CLI is running?
0.147.0
What subscription do you have?
plus
Which model were you using?
No response
What platform is your computer?
No response
What terminal emulator and version are you using (if applicable)?
No response
Codex doctor report
What issue are you seeing?
On WSL2, when a project lives on a Windows drive mounted under /mnt/<drive> and the path contains mixed-case components, every resumed session restores an all-lowercased cwd. For example, the original cwd /mnt/m/2026/TesT becomes /mnt/m/2026/test after resume.
This is not just cosmetic — it breaks permission management:
- Project trust is lost.
~/.codex/config.tomlstores trusted projects keyed by the original-case path ([projects."/mnt/m/2026/TesT"] trust_level = "trusted"), but the resumed session's cwd is lowercasetest, so the trust lookup misses. The trust screen is shown again and project-local config / hooks / exec policies are treated as untrusted. - Commands require approval every time. Path-based access checks compare against workspace roots / recorded paths that still carry the original casing, so they no longer match. Commands that previously ran without prompting now ask for approval — even though on the drvfs mount
testandTesTresolve to the same directory.
What steps can reproduce the bug?
- On WSL2 create a mixed-case dir on a Windows drive:
mkdir -p /mnt/<drive>/path/TesT && cd /mnt/<drive>/path/TesT - Start
codex, send any message, and trust the project when prompted (writes the original-case key intoconfig.toml). Let a command get approved/run. /newin the same window.- Exit, then resume the session (
codex resumeor/resume).
What is the expected behavior?
No response
Additional information
I successfully fixed this issue at https://github.com/scmmm/codex/tree/fix/wsl-resume-cwd-case.
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 tracing how resumed sessions load the cwd from the state DB and compare it with the original-case project key in ~/.codex/config.toml. Reproduce the mixed-case WSL2 path scenario, then verify that resuming preserves the cwd casing and continues matching project trust and approval paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, operating-systems, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100