Codex shell execution does not match real user session (1Password/op + glab), causing auth mismatches
I’m reporting a reproducible workflow issue that makes Codex unreliable for real developer automation.
In my normal terminal, zsh + op + glab work correctly (same directory, same hooks, same token resolution).
In Codex-run commands, even with login/interactive zsh attempts, the environment is different:
1Password desktop app integration is not reliably available
op://-based secret loading behaves differently
glab resolves to a different auth context than in my actual terminal
group/project access checks fail in Codex while succeeding locally
This leads to repeated failures and manual copy/paste fallbacks, which defeats the purpose of agent automation.
Expected behavior
Codex should be able to run in the exact same effective shell/session context as the user’s terminal (including keychain/app bridges and shell hooks), or
clearly expose a “true user session mode” for auth-sensitive developer workflows.
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
The difference you're seeing are likely due to the limitations imposed by the sandbox. You'll need to investigate this further yourself if you want to diagnose why your particular tools behave differently within the sandbox. It's likely that they need to access some resource (networking, writes to files outside of your project, or other system calls that are restricted by the sandbox). It's also possible that this is related to environment variables defined in your environment.
In any case, this is probably not something that we will be able to investigate because we won't be able to repro your exact environment.