`shell_snapshot=true` breaks rc handling such as `direnv`, affecting ability to use Codex app's worktrees
What issue are you seeing?
When shell_snapshot=true, various load-bearing capabilities no longer work. For example:
- When using the Codex app, there is no way to automatically setup worktree/session-scoped environment variables without
direnv direnvdoes not work or is not evaluated w- This is often important for python projects, which need to scope a virtual environment for a worktree
While I'm sure this is a problem more broadly with the app-server / session scoping, this is particularly annoying a problem with the Codex app where you can't simply setup a shell session before running codex (cli) that has the correct env setup.
What steps can reproduce the bug?
Setup environment.toml
# .codex/enviroments/personal-joeyp.toml
version = 1
name = "joeyp"
[setup]
script = '''
#!/usr/bin/env bash
set -euo pipefail
echo 'export FOO=BAR' > .envrc
direnv allow
'''
# ~/.zprofile
# ensure direnv hooks are installed
eval $(direnv hook zsh)
# paranoid "evaluate now with pwd"
direnv export zsh
Then, with shell_snapshot=true, the shell snapshot will not have FOO=BAR. Without it, the worktree sessions will be able to observe it.
What is the expected behavior?
_No response_
Additional information
This feels like more of a general pain with the Codex app. I'd like to be able to setup worktree-specific session envrionment variables, but it's not apparent that's possible without the means of a more complicated shell setup like direnv so the app's worktree support isn't as "batteries included"
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗