Make 'snapshot_shell' store non-exported environment

Resolved 💬 5 comments Opened Feb 20, 2026 by CarloWood Closed Mar 29, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

And is therefore not usable.

thread ID 019c7cf8-95bb-78e3-9668-1272b5434750

View original on GitHub ↗

5 Comments

github-actions[bot] contributor · 6 months ago

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

  • #11223

Powered by Codex Action

etraut-openai contributor · 6 months ago

This feature is working as designed. If it's not meeting your needs, let's explore why. Can you explain your use case in more detail?

CarloWood · 6 months ago

Well, then I'll just turn the 'shell_snapshot' off. Weird design though, to change the environment that one works in depending on if this feature is on or off.

My use case is that I have a whole system around the bash environment: automatic history and environment switching, my build system (basically my "IDE" is implement in the environment) and recently everything codex. It is just huge.

And I rely on environment variables to be set as I set them in, among others, ~/.bash_profile.
Without the snapshot feature: they are always set. With the snapshot feature: all the non-exported environment variables and functions are no longer defined - completely breaking everything.

I don't want to export them, they are local to the current bash. There should be no reason to export them just so they get saved by the shell snapshot feature.

CarloWood · 6 months ago

Just a few environment variable (not showing any bash functions, those are too long):

This is inside the Codex environment (that I start by running codex shell, where codex is a bash function):

daniel-codex:~/workspace/konsole/src/konsole.git/>set | grep CODEX
CODEX_DIRECTORY=
CODEX_INSIDE_ENVIRONMENT=1
CODEX_REPOBASE=konsole/src/konsole.git
CODEX_SHELL=yes
CODEX_WORKSPACE=/opt/ext4/nvme2/codex/workspace

This environment is inside the bwrap container that Codex runs in. I can use it to see what Codex sees.

If then I type exit to return to the host environment:

daniel:~/projects/github/konsole/konsole/src/konsole.git>set | grep CODEX
CODEX_DIRECTORY=
CODEX_HOME=/home/carlo/.codex
CODEX_REPOBASE=konsole/src/konsole.git
CODEX_WORKSPACE=/home/carlo/projects/github/konsole
HOME_CODEX=/opt/ext4/nvme2/codex

Now multiply that with 100 and you get an idea ;)

etraut-openai contributor · 5 months ago

This feature request hasn't received enough upvotes, so I'm closing it.