YOLO/full-access still runs non-interactive login shell; zsh-only env (rbenv) not loaded

Resolved 💬 1 comment Opened Dec 16, 2025 by kieranklaassen Closed Apr 3, 2026

Summary

Even with YOLO/full-access, Codex CLI executes tool commands in a non-interactive login shell (e.g. bash -lc / zsh -lc). If env setup is only in ~/.zshrc, it is not applied. This causes rbenv shims to be missing and the wrong Ruby to be used inside Codex.

Version

Codex CLI v0.73.0 (npm @openai/codex)

Platform

macOS (login shell: /bin/zsh)

Steps to reproduce

  1. Put rbenv init only in ~/.zshrc (not ~/.zprofile).
  2. Run Codex with YOLO/full-access (no sandbox/approvals).
  3. Ask Codex to run: which ruby / ruby -v.

Actual

Codex resolves /usr/bin/ruby (or another non-rbenv Ruby) because the login shell doesn’t source ~/.zshrc.

This reproduces outside Codex with:

zsh -lc 'which ruby; ruby -v'

Expected

YOLO/full-access should use the same shell env as the user’s interactive shell, or at least load the login profile so rbenv shims are available.

Notes / Workaround

  • Move rbenv init to ~/.zprofile, or
  • Set shell_environment_policy.experimental_use_profile = true

Related: #3916, #4210

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗