Repository navigation
Add --codex-args for every Codex worker - #3
Merged
Merged
Conversation
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
force-pushed
the
office/cosmo-36eb
branch
from
October 22, 2026 12:38
ce3dd58 to
64041ce
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
--codex-args <str>(envAGENT_OFFICE_CODEX_ARGS): extra args for every Codex worker, whether Codex is the office's--agentor picked when hiring, on a fresh start and on every resume.--agent-argsstill 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:
--agent-args(when Codex is the--agent)--codex-args, without repeating a valueless switch already there (--full-auto,--search,--oss,--no-alt-screen)withYolo), for a worker hired in yolo--modelfrom 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 fromPROVIDER_META.codex.yolo.codex-args.tsno longer keeps its own copy. If--agent-argsor--codex-argsasks for yolo by either name,withCodexArgspasses the line throughwithYolo. So however many of--agent-args,--codex-argsand 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.withYoloalso collapses a line that already has both names down to the first one. A newhasYolohelper inyolo.tsis shared.--codex-args --yologives a worker the same command line as the box, but its card isn't markedDocs
README (common options),
docs/configuration.md(options list) anddocs/agents.md(the provider section and the Yolo section) describe--codex-args, the box, and how the two combine.Verified locally
npm run typecheck: passesnode --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 passnpm run build: passestests/workers.test.tscases) was not run locally because the machine is low on memory; CI runs it.New tests:
--codex-args --yolois givenwithYolocollapses both names into onehasYoloworkers.test.tshire in yolo with-a on-requestin agent-args and--codex-args --yoloNote: Codex CLI 0.163.0 no longer accepts
--full-autoat all. It stays in the dedupe list for older versions.🤖 Generated with Claude Code