Skip to content

Add --codex-args for every Codex worker - #3

Merged
dextah merged 1 commit into
mainfrom
office/cosmo-36eb
Oct 22, 2026
Merged

dextah merged 1 commit into
mainfrom
office/cosmo-36eb

Conversation

@dextah

@dextah dextah commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Adds --codex-args <str> (env AGENT_OFFICE_CODEX_ARGS): extra args for every Codex worker, whether Codex is the office's --agent or picked when hiring, on a fresh start and on every resume. --agent-args still only reaches the default agent. Rebased onto the fork's main (#1, #2, #4).

Behaviour

The Codex adapter builds its command line in this order:

  1. --agent-args (when Codex is the --agent)
  2. --codex-args, without repeating a valueless switch already there (--full-auto, --search, --oss, --no-alt-screen)
  3. the Yolo (skip approvals) box's flag (withYolo), for a worker hired in yolo
  4. the worker's model/effort (it replaces a --model from either set of args), then the hooks, the MCP server and --no-alt-screen (if not already there)

Yolo now runs on one system. The bypass flag and its aliases (--dangerously-bypass-approvals-and-sandbox / --yolo) and the conflicts (-a / --ask-for-approval) come only from PROVIDER_META.codex.yolo. codex-args.ts no longer keeps its own copy. If --agent-args or --codex-args asks for yolo by either name, withCodexArgs passes the line through withYolo. So however many of --agent-args, --codex-args and the box ask for it, a Codex worker gets exactly one bypass flag, and any approval policy is dropped with its value, because Codex refuses to start with both. withYolo also collapses a line that already has both names down to the first one. A new hasYolo helper in yolo.ts is shared.

--codex-args --yolo gives a worker the same command line as the box, but its card isn't marked ⚠️ Yolo, and unticking the box doesn't remove it.

Docs

README (common options), docs/configuration.md (options list) and docs/agents.md (the provider section and the Yolo section) describe --codex-args, the box, and how the two combine.

Verified locally

  • npm run typecheck: passes
  • node --import tsx --test tests/codex-args.test.ts tests/yolo.test.ts tests/codex.test.ts tests/prompts.test.ts tests/size.test.ts: 34/34 pass
  • npm run build: passes
  • The full suite (including the new tests/workers.test.ts cases) was not run locally because the machine is low on memory; CI runs it.

New tests:

  • an approval policy is dropped when --codex-args --yolo is given
  • one bypass flag across every combination of agent-args, codex-args and the box, fresh and resumed
  • the order of the pieces on the command line
  • withYolo collapses both names into one
  • hasYolo
  • a workers.test.ts hire in yolo with -a on-request in agent-args and --codex-args --yolo

Note: Codex CLI 0.163.0 no longer accepts --full-auto at all. It stays in the dedupe list for older versions.

🤖 Generated with Claude Code

@dextah
dextah marked this pull request as ready for review October 22, 2026 10:09
Adds a --codex-args CLI flag / AGENT_OFFICE_CODEX_ARGS env var whose args
reach every Codex worker regardless of the office's default agent.

Built on the Yolo box (#2): the yolo/bypass aliases come only from
PROVIDER_META.codex.yolo via withYolo, and codex-args.ts dedupes just the
other valueless switches (--full-auto, --search, --oss, --no-alt-screen).
The Codex launch goes agent-args, --codex-args, the Yolo box, then
model/effort, hooks, MCP and --no-alt-screen, so a worker ends up with one
bypass flag whichever of them asked for it, and a --yolo in --codex-args
drops -a/--ask-for-approval and its value, as the box does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dextah
dextah force-pushed the office/cosmo-36eb branch from ce3dd58 to 64041ce Compare October 22, 2026 12:38
@dextah
dextah merged commit 105f150 into main Oct 22, 2026
2 checks passed
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