fix(exec): skip git repo check when --yolo flag is used#9590
Conversation
The --yolo (--dangerously-bypass-approvals-and-sandbox) flag is documented to skip all confirmation prompts and execute commands without sandboxing, intended for environments that are externally sandboxed. However, it was not bypassing the trusted directory (git repo) check, requiring users to also specify --skip-git-repo-check. This change makes --yolo also skip the git repo check, matching the documented behavior and user expectations. Fixes openai#7522 Co-Authored-By: Claude <noreply@anthropic.com>
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@zerone0x, you'll need to sign the CLA. |
|
I have read the CLA Document and I hereby sign the CLA |
Summary
Fixes #7522
The
--yolo(--dangerously-bypass-approvals-and-sandbox) flag is documented to skip all confirmation prompts and execute commands without sandboxing, intended solely for running in environments that are externally sandboxed. However, it was not bypassing the trusted directory (git repo) check, requiring users to also specify--skip-git-repo-check.This change makes
--yoloalso skip the git repo check, matching the documented behavior and user expectations.Changes
codex-rs/exec/src/lib.rsto check fordangerously_bypass_approvals_and_sandboxflag in addition toskip_git_repo_checkwhen determining whether to skip the git repo checkTesting
cargo check -p codex-execcargo test -p codex-exec(34 passed, 8 integration tests failed due to unrelated API connectivity issues)🤖 Generated with Claude Code