Skip to content

Initial codex CLI harness setup#9370

Merged
liliwilson merged 3 commits intomasterfrom
lili/remote-1502-initial-harness-setup-client-side-for-codex
Apr 30, 2026
Merged

Initial codex CLI harness setup#9370
liliwilson merged 3 commits intomasterfrom
lili/remote-1502-initial-harness-setup-client-side-for-codex

Conversation

@liliwilson
Copy link
Copy Markdown
Contributor

@liliwilson liliwilson commented Apr 29, 2026

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 ThirdPartyHarness trait for codex.

Notable decisions:

  • We run the CLI with --dangerously-bypass-approvals-and-sandbox (docs)
  • We provide the system prompt by writing to 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.
  • Codex, like Gemini, unfortunately doesn't support file input or redirecting stdin. We reuse the $(cat prompt_file) approach here for now.

Testing

Tested E2E in downstream PR, #9376

Also confirmed that it picks up the system prompt instructions:
image

Server API dependencies

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

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

@cla-bot cla-bot Bot added the cla-signed label Apr 29, 2026
Copy link
Copy Markdown
Contributor Author

liliwilson commented Apr 29, 2026

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>
@liliwilson liliwilson force-pushed the lili/remote-1502-initial-harness-setup-client-side-for-codex branch from 91ad4c8 to 926d782 Compare April 29, 2026 05:39
@liliwilson liliwilson force-pushed the lili/remote-1502-initial-harness-setup-client-side-for-codex branch from 926d782 to 35e5817 Compare April 29, 2026 05:47
@liliwilson liliwilson marked this pull request as ready for review April 29, 2026 07:17
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Apr 29, 2026

@liliwilson

I ran into an unexpected error while working on this.

Powered by Oz

@liliwilson liliwilson requested a review from oz-agent April 29, 2026 07:26
Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 [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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor

@abhishekp106 abhishekp106 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exciting!

@liliwilson liliwilson merged commit 9551831 into master Apr 30, 2026
38 checks passed
@liliwilson liliwilson deleted the lili/remote-1502-initial-harness-setup-client-side-for-codex branch April 30, 2026 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants