Initial codex CLI harness setup#9370
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Mirrors the Gemini setup. Adds Harness::Codex everywhere Harness::Gemini is wired and a CodexHarness driver impl that launches the codex TUI with --yolo (= -s danger-full-access -a never) and a temp-file prompt via $(cat ...) substitution. Co-Authored-By: Oz <oz-agent@warp.dev>
91ad4c8 to
926d782
Compare
926d782 to
35e5817
Compare
|
I ran into an unexpected error while working on this. Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds Codex as a selectable/dispatchable third-party harness, wires it through the GraphQL and display mappings, and implements a Codex harness runner that launches the CLI and uploads block snapshots.
Concerns
- The Codex harness currently injects Warp's trusted system prompt via
~/.codex/AGENTS.override.md. Codex loads that as global AGENTS guidance before repo/project AGENTS files, so repository-controlled instructions can supersede it; that is especially risky because the command also disables approvals and sandboxing.
Verdict
Found: 1 critical, 0 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| }; | ||
| let home_dir = | ||
| dirs::home_dir().ok_or_else(|| anyhow::anyhow!("could not determine home directory"))?; | ||
| write_codex_agents_override(&home_dir.join(CODEX_CONFIG_DIR), prompt) |
There was a problem hiding this comment.
🚨 [CRITICAL] This stages Warp's trusted system prompt as global AGENTS guidance, but Codex appends project AGENTS files after global guidance, so repo-controlled instructions can override it while the harness is running with approvals and sandboxing disabled; pass the prompt through Codex developer/system instruction config (-c developer_instructions=... or a temp model_instructions_file) instead of AGENTS.override.md.
There was a problem hiding this comment.
developer_instructions is also promising—might switch to this in a future PR (since a lot of the infrastructure for adding to the config files is introduced in #9376)

Description
This PR sets up the initial plumbing for supporting the Codex CLI with multi-harness. It follows the existing pattern for Claude Code and Gemini, implementing the
ThirdPartyHarnesstrait for codex.Notable decisions:
--dangerously-bypass-approvals-and-sandbox(docs)AGENTS.override.md(docs)—codex reads this first and recommends it for temporary instructions. It doesn't really matter yet which we use since these are running in a cloud agent context where we control the FS.$(cat prompt_file)approach here for now.Testing
Tested E2E in downstream PR, #9376
Also confirmed that it picks up the system prompt instructions:

Server API dependencies
Relies on the support for Codex added to the server in https://github.com/warpdotdev/warp-server/pull/10740
Agent Mode