Codex

RoboCo can run delivery agents on OpenAI's Codex CLI, authenticated by a ChatGPT subscription rather than a metered API key — the same "subscription, not credits" posture as the Grok path, so a Codex-routed dev can't stall mid-task on exhausted API spend.

V1: delivery roles only

Codex runs the developer/QA/documenter/PM delivery roles. It does not back the interactive Intake or Secretary chats — those stay on Anthropic even under the one-click Codex mode, and an explicit per-agent pin to Codex on either seat is refused at spawn. This is a deliberate V1 scope, not a bug.

Set it up once

Authenticate Codex on the host with the official CLI, then point RoboCo at the resulting directory:

bash
1codex login                    # once, on the host — creates ~/.codex/auth.json

Then in .env:

bash
1ROBOCO_HOST_CODEX_DIR=/home/youruser/.codex   # the REAL host ~/.codex to mount in2# ROBOCO_CODEX_CLI_MODEL=gpt-5.3-codex        # codex has no reliable default — always set explicitly

Finally, on Settings → AI Providers, either click the Codex mode button (whole fleet, delivery roles) or pin individual agents to a gpt-* model in Mix mode — see Choosing a provider for the full precedence ladder.

A whole directory is mounted, not a single file

Unlike a single-file bind mount (which would pin the file's inode and block the orchestrator's own token refresh from ever reaching a running container), ROBOCO_HOST_CODEX_DIR is mounted read-only as a directory. Each agent's entrypoint symlinks ~/.codex/auth.json to that mount, while Codex's own writable state (config.toml, rules/, sessions/) lives in the image's own ~/.codex — so the CLI can write locally without ever touching your host credential.

The token refreshes itself

Codex's access token is a JWT whose exp claim is the only expiry signal — there's no sibling expires_at field the way Grok's bundle carries one. The orchestrator runs the same refresh-loop shape as Grok's:

  • It mints a fresh token from the refresh-token grant against auth.openai.com/oauth/token before expiry and atomically rewrites the shared auth.json.
  • The refresh token is single-use: a process-wide lock (with a re-check inside the lock) guards against two refreshes racing and double-burning it.
  • If your account needs a different OAuth client id than the built-in default, override it with ROBOCO_CODEX_OAUTH_CLIENT_ID — a bad refresh never mutates auth.json, so the worst case is a parked provider, not a corrupted credential.

Guardrails without a --disallowed-tools flag

The Codex CLI has no CLI-flag equivalent to Grok's --disallowed-tools, so RoboCo enforces the same boundaries a different way:

  • Per-role sandbox levelworkspace-write for the developer role, read-only for every other Codex-routed role.
  • One shared execpolicy file (~/.codex/rules/default.rules, Starlark prefix_rules) denies git-mutation, destructive, and raw package-manager commands — the same guardrail the bash-guard hook enforces on the Claude path.
  • No verified system-prompt-file mechanism — the composed role blueprint (team/role/identity layers) is prepended directly into the task prompt instead of mounted as a separate system file.

No exit-code taxonomy — classified from the transcript's own error field

Every Codex CLI failure exits 1, unlike Grok's or Gemini's distinguishable exit codes. RoboCo classifies a run's terminal state (rate-limit, auth failure, or neither) from the run's own structured JSONL error.message field plus stderr — never the model's own transcript prose, which could false-positive on ordinary on-topic text (this repo's own prompts, for instance, use the phrase "quota-limited" in plain engineering prose). A detected rate-limit or auth failure parks the Codex provider exactly like a Grok/Gemini exit does, and the background probe-and-resume loop revives it once the condition clears.

Usage and cost still show up

Unlike Grok's output-only cost fallback, Codex usage capture sums each run's turn.completed events for a genuine four-bucket split — input, output, cache-read, cache-write — into the same usage-tracking shape every other provider feeds. Codex traffic lands on the same usage dashboard as Claude and Grok, priced from the captured session totals.

Next

llms.txt