codex
v0.1.5OpenAI Codex as an iii worker; codex::run/start/stop/status/sessions::list spawn the codex CLI for headless turns, mirror raw thread events onto codex::events, and stream AgentEvent frames onto agent::events.
- macOS: arm64 · x64
- Linux: arm64 · armv7 · x64
- Windows: arm64 · x64 · x86
exact versions are immutable; binary and bundle artifacts are digest-pinned.
skill doc
codex
The codex worker exposes the OpenAI Codex API as iii functions. One
codex::run call executes one headless Codex turn — the same agent the user
runs in their terminal, with the same login, filesystem, and sandbox — in a
chosen working directory, and returns the final result and token usage. The
worker is a pure pass-through: named payload fields cover the common path,
the options field forwards any Codex SDK ThreadOption verbatim, and every
thread event mirrors untouched onto the codex::events stream. A translated
AgentEvent view lands on agent::events, which is what the iii console
renders.
Requires the codex CLI on the host with an existing codex login or
OPENAI_API_KEY in the worker environment. When a turn needs a capability
beyond Codex itself, add another iii worker to the bus instead of bolting
anything onto this one.
When to Use
- Delegate a whole coding task ("add an endpoint and run the tests") in one
call, instead of orchestrating individual
coder::*/shell::*calls yourself:codex::runwithpromptandcwd. - Continue a conversation across calls: pass the same
session_idagain and the worker resumes the underlying Codex thread with full context. - Run long jobs without holding the call open:
codex::startreturns{session_id, started}immediately; followcodex::events(group_id = session_id) for raw progress oragent::eventsfor the rendered view; interrupt withcodex::stop. - Act on the whole backend: turns carry the iii runtime context by default
(delivered as Codex
developer_instructions), so the agent discovers and calls any registered function through the iii CLI (engine::functions::list,iii trigger); disable per turn with--help iii_context: false. - Plan before touching anything: run the planning prompt with
sandbox_mode: read-only(writes physically fail), read the plan, then send "implement the plan" on the samesession_idwithsandbox_mode: workspace-write. - Get structured final output: pass
output_schema(JSON schema) and the final agent message is JSON matching it. - Attach screenshots or diagrams:
images: ["/path/a.png"]adds local images to the prompt. - Wire MCP servers or model providers into one turn:
codex_configforwards anyconfig.tomloverride, e.g.{"codex_config": {"mcp_servers": {"github": {"command": "gh-mcp"}}}}. - Reach past the named payload fields: anything the SDK ThreadOptions
accept goes through
optionsunchanged, e.g.{"options": {"networkAccessEnabled": true, "webSearchMode": "live"}}.
Boundaries
- Spawns the host
codexCLI per turn — needs Codex installed and authenticated; not available inside a bare container without it. - Execution safety is Codex's own sandbox (
sandbox_mode), not the engine's:read-onlyblocks writes,workspace-writeallows edits incwd,danger-full-accessdisables the sandbox. Headless turns runapproval_policy: never, so blocked commands fail instead of prompting. - One turn per session at a time: check
codex::status(live: true) before sending anothercodex::runfor the samesession_id; parallel runs against one session race on the underlying thread resume. agent::eventscarries whole-message frames; per-item progress detail (command output as it accumulates, todo lists) exists only oncodex::events.
Functions
codex::run— run one Codex turn and wait; acceptsprompt(or amessagesarray whose last user entry becomes the prompt), plusmodel,cwd,sandbox_mode,approval_policy,reasoning_effort,skip_git_repo_check,output_schema, and rawoptions; returns{session_id, codex_thread_id, result, stop_reason, usage}.codex::start— same payload, returns{session_id, started}immediately; progress arrives on the streams.codex::stop— interrupt the live run for a session.codex::status— point-in-time session view: live flag, status, turns, usage.codex::sessions::list— every session this worker has run.