codex icon indicating copy to clipboard operation
codex copied to clipboard

commands like "codex resume `session-id`" do not respect CODEX_HOME

Open fallonou1999 opened this issue 1 year ago • 5 comments

What version of Codex is running?

codex-cli 0.46.0

What subscription do you have?

pro

Which model were you using?

gpt-5 high

What platform is your computer?

Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64

What issue are you seeing?

running command CODEX_HOME="XXX" codex resume %session_id% starts a new session with different session id, while config.toml is correctly loaded and session jsonl will be saved to CODEX_HOME(but you can't resume it with previous command)

What steps can reproduce the bug?

1.run CODEX_HOME="XXX" codex 2.exit codex 3.run CODEX_HOME="XXX" codex resume %session_id% (session id is provided by exiting message by codex) 4.a new session starts instead of resuming session in step 1

What is the expected behavior?

when running resume command with CODEX_HOME, correct session could be loaded

Additional information

1.running CODEX_HOME="XXX" codex resume then choose wanted session works 2.related logs 2025-10-16T05:24:53.900573Z ERROR Error finding conversation path: 0199e96c-7d0c-7403-bf30-395693cd1788 2025-10-16T05:24:57.095886Z  INFO aggregated 12 tools from 3 servers 2025-10-16T05:25:01.442102Z  INFO ERR: No such file or directory (os error 2) 2025-10-16T05:27:33.540101Z  INFO Shutting down Codex instance 2025-10-16T05:43:41.451194Z ERROR Error finding conversation path: 0199eb7a-7010-72b2-bc68-c8399e9e182e 2025-10-16T05:43:45.345846Z  INFO aggregated 12 tools from 3 servers 2025-10-16T05:45:09.291282Z  INFO ERR: No such file or directory (os error 2) 2025-10-16T05:46:50.482043Z  INFO ERR: No such file or directory (os error 2) 2025-10-16T05:46:50.218842Z  INFO ERR: No such file or directory (os error 2) 2025-10-16T05:47:01.119434Z  INFO ERR: No such file or directory (os error 2) 2025-10-16T05:47:09.088110Z  INFO ERR: No such file or directory (os error 2) 2025-10-16T05:47:49.256007Z  INFO ERR: No such file or directory (os error 2) 2025-10-16T05:47:51.297212Z  INFO ERR: No such file or directory (os error 2) 2025-10-16T05:47:52.100984Z  INFO ERR: No such file or directory (os error 2) 2025-10-16T05:47:56.316442Z  INFO ERR: No such file or directory (os error 2) 2025-10-16T05:48:06.972737Z  INFO ERR: No such file or directory (os error 2) 2025-10-16T05:48:08.892258Z  INFO ERR: No such file or directory (os error 2) 2025-10-16T05:48:13.797365Z  INFO ERR: No such file or directory (os error 2) 2025-10-16T05:48:20.307741Z  INFO ERR: No such file or directory (os error 2) 3.if there is really a bug in command like CODEX_HOME="XXX" codex resume %session_id%, would any other command have similar issues?

fallonou1999 avatar Oct 16 '25 08:10 fallonou1999

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #4703
  • #4791
  • #3817
  • #3856

Powered by Codex Action

github-actions[bot] avatar Oct 16 '25 08:10 github-actions[bot]

Same about the Codex extension for VS Code. Without per-project settings, I can't use Codex in VS Code Have to return to that laggy Android Studio + Codex CLI... Hope, @tibo-openai, the team will prioritize per-project experience

version: 0.46.0 platform: macOS environment: Flutter + direnv

The only way to have per-project experience in Codex CLI (Terminal in Android Studio):

  1. Install direnv
  2. Create .envrc file:
export MCP_REMOTE_CONFIG_DIR="$PWD/.mcp-auth"
export CODEX_HOME="$PWD/.codex"
  1. Allow direnv in the project directory

Artein avatar Oct 18 '25 12:10 Artein

@fallonou1999 Is the CODEX_HOME you are using covered by a .gitignore perhaps? I can reproduce the latter, but not any other issues. Would love more information to get to the bottom of this one.

tibo-openai avatar Oct 18 '25 20:10 tibo-openai

i can confirm it happens only if the path is in gitignore

MarianoFacundoArch avatar Oct 21 '25 00:10 MarianoFacundoArch

@fallonou1999 Is the CODEX_HOME you are using covered by a .gitignore perhaps? I can reproduce the latter, but not any other issues. Would love more information to get to the bottom of this one.

yes I have this in my .gitignore: .codex/** !.codex/config.toml

fallonou1999 avatar Oct 22 '25 14:10 fallonou1999