Skip to content

Omit redundant -a on-request from shipped codex harness - #104

Merged
JacobStephens2 merged 2 commits into
mainfrom
fix/codex-harness-yolo-flag
Sep 13, 2026
Merged

JacobStephens2 merged 2 commits into
mainfrom
fix/codex-harness-yolo-flag

Conversation

@JacobStephens2

Copy link
Copy Markdown
Owner

Summary

Removes -a on-request from etc/harnesses.d/codex.conf.

Context & Motivation

When launching Codex via va codex --yolo, vaulted-agent appends operator flags to the configured harness command:

codex -s danger-full-access -a on-request --yolo

Because Codex CLI's argument parser (built on clap) treats --ask-for-approval (-a <policy>) and --dangerously-bypass-approvals-and-sandbox (--yolo) as mutually exclusive, this fails fatally:

error: the argument '--ask-for-approval <APPROVAL_POLICY>' cannot be used with '--dangerously-bypass-approvals-and-sandbox'

Codex already defaults to OnRequest when no approval flag is given (including with -s danger-full-access). Omitting -a on-request preserves normal behavior while allowing --yolo (and explicit -a never / -a on-request) to pass through without conflict.

Changes

  • etc/harnesses.d/codex.conf: Change command = codex -s danger-full-access -a on-request to command = codex -s danger-full-access.
  • README.md: Update the sample vaulted-agent pick table row for codex.
  • AGENTS.md: Add troubleshooting entry for Permission denied on project configs (e.g. ~/.codex/config.toml mode 0600) when launched from an operator home with workdir = caller.
  • tests/cli_launch.rs: Add shipped_codex_harness_preserves_extra_args_without_approval_conflict integration test.

Verification

  • Added integration test passes: test shipped_codex_harness_preserves_extra_args_without_approval_conflict ... ok
  • All 13 tests in tests/cli_launch.rs pass.
  • Verified on live host running va codex --yolo doctor and va codex doctor as operator.

JacobStephens2 and others added 2 commits September 11, 2026 17:03
Codex CLI treats --ask-for-approval (-a <policy>) and
--dangerously-bypass-approvals-and-sandbox (--yolo) as mutually
exclusive clap arguments. Because vaulted-agent forwards operator flags
by appending them to the harness command line, having -a on-request baked
into etc/harnesses.d/codex.conf caused 'va codex --yolo' to fail at clap
validation.

Codex already defaults to OnRequest when no approval flag is given, so
omitting -a on-request preserves normal behavior while allowing --yolo
(or custom -a <policy> overrides) to pass cleanly.

Also:
- Update README pick example row for codex
- Add regression test in tests/cli_launch.rs
- Add troubleshooting entry in AGENTS.md for permission denied on project
  configs in operator homes with workdir=caller
@JacobStephens2
JacobStephens2 merged commit 430b726 into main Sep 13, 2026
2 checks passed
@JacobStephens2
JacobStephens2 deleted the fix/codex-harness-yolo-flag branch September 13, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant