Skip to content

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

@kieranklaassen

Description

@kieranklaassen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIbugSomething isn't workingtool-callsIssues related to tool calling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions