You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE] CODEX_HOME should support shared auth with isolated config/skills #15410
When using CODEX_HOME to isolate config and skills for programmatic eval/CI use cases, authentication breaks because auth.json cannot be reliably copied or symlinked between the real ~/.codex/ and the custom CODEX_HOME.
The root cause: OAuth refresh tokens in auth.json are single-use. When the real Codex instance refreshes the token, any copy becomes invalid. This makes CODEX_HOME unusable for config isolation while maintaining ChatGPT subscription auth.
Use case
Running eval experiments where each agent run needs:
Isolated config: no personal MCP servers, hooks, or settings
Custom skills: only specific skills installed (to A/B test skill effectiveness)
Shared auth: still uses the user's ChatGPT subscription (no separate API key billing)
Non-interactive: codex exec in automation
Current behavior
Set CODEX_HOME=/tmp/eval_home with minimal config.toml and custom skills/
Copy auth.json from ~/.codex/auth.json
First run may work (uses cached access token)
Subsequent runs fail with 401 if the real Codex refreshed the token, invalidating the copy
Proposed solution
Either:
Auth fallback: when CODEX_HOME is set and auth.json is missing or invalid, fall back to ~/.codex/auth.json for authentication only (not config/skills)
Auth symlink support: detect and follow symlinks for auth.json so both paths read the same file
Separate auth path: CODEX_AUTH_HOME or --auth-from flag to specify where auth is read from, independent of CODEX_HOME
This is by design, and we're unlikely to change this. CODEX_HOME allows you to specify a different — and independent — codex home directory. There are users who depend on this for separate and independent auth.
The auth is cached on disk, so if you want to use the same auth in different codex homes, you can auth separately in each of them.
Activity
github-actions commentedon Mar 21, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
etraut-openai commentedon Mar 21, 2026
This is by design, and we're unlikely to change this.
CODEX_HOMEallows you to specify a different — and independent — codex home directory. There are users who depend on this for separate and independent auth.The auth is cached on disk, so if you want to use the same auth in different codex homes, you can auth separately in each of them.
feat: mid-turn delivery + multi-layer worker liveness + Bug 29 follow…
feat(optio-codex): credential watcher — save-back + lease renewal (St…
feat(optio-codex): engine-free seed verify/refresh via codex exec pro…
fix(optio-codex): graceful teardown for seeded sessions so a rotated …
Do not copy auth.json into the second home; the refresh token is sing…