Skip to content

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

Closed

Description

@fallonou1999

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
�[2m2025-10-16T05:24:53.900573Z�[0m �[31mERROR�[0m Error finding conversation path: 0199e96c-7d0c-7403-bf30-395693cd1788
�[2m2025-10-16T05:24:57.095886Z�[0m �[32m INFO�[0m aggregated 12 tools from 3 servers
�[2m2025-10-16T05:25:01.442102Z�[0m �[32m INFO�[0m ERR: No such file or directory (os error 2)
�[2m2025-10-16T05:27:33.540101Z�[0m �[32m INFO�[0m Shutting down Codex instance
�[2m2025-10-16T05:43:41.451194Z�[0m �[31mERROR�[0m Error finding conversation path: 0199eb7a-7010-72b2-bc68-c8399e9e182e
�[2m2025-10-16T05:43:45.345846Z�[0m �[32m INFO�[0m aggregated 12 tools from 3 servers
�[2m2025-10-16T05:45:09.291282Z�[0m �[32m INFO�[0m ERR: No such file or directory (os error 2)
�[2m2025-10-16T05:46:50.482043Z�[0m �[32m INFO�[0m ERR: No such file or directory (os error 2)
�[2m2025-10-16T05:46:50.218842Z�[0m �[32m INFO�[0m ERR: No such file or directory (os error 2)
�[2m2025-10-16T05:47:01.119434Z�[0m �[32m INFO�[0m ERR: No such file or directory (os error 2)
�[2m2025-10-16T05:47:09.088110Z�[0m �[32m INFO�[0m ERR: No such file or directory (os error 2)
�[2m2025-10-16T05:47:49.256007Z�[0m �[32m INFO�[0m ERR: No such file or directory (os error 2)
�[2m2025-10-16T05:47:51.297212Z�[0m �[32m INFO�[0m ERR: No such file or directory (os error 2)
�[2m2025-10-16T05:47:52.100984Z�[0m �[32m INFO�[0m ERR: No such file or directory (os error 2)
�[2m2025-10-16T05:47:56.316442Z�[0m �[32m INFO�[0m ERR: No such file or directory (os error 2)
�[2m2025-10-16T05:48:06.972737Z�[0m �[32m INFO�[0m ERR: No such file or directory (os error 2)
�[2m2025-10-16T05:48:08.892258Z�[0m �[32m INFO�[0m ERR: No such file or directory (os error 2)
�[2m2025-10-16T05:48:13.797365Z�[0m �[32m INFO�[0m ERR: No such file or directory (os error 2)
�[2m2025-10-16T05:48:20.307741Z�[0m �[32m INFO�[0m 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?

Activity

  1. added
    bug
    on Oct 16, 2025
  2. Artein commented on Oct 18, 2025

    @Artein

    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
  3. tibo-openai commented on Oct 18, 2025

    @tibo-openai
    Collaborator

    @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.

  4. self-assigned this
    on Oct 18, 2025
  5. MarianoFacundoArch commented on Oct 21, 2025

    @MarianoFacundoArch

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

  6. fallonou1999 commented on Oct 22, 2025

    @fallonou1999
    Author

    @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

  7. added a commit that references this issue on Oct 23, 2025
    3059373
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions