feat(codex): add codex as a native benchmark agent - #2
Closed
arielnabavian wants to merge 2 commits into
Closed
arielnabavian wants to merge 2 commits into
arielnabavian wants to merge 2 commits into
Conversation
added 2 commits
August 12, 2026 16:40
Adds Codex (OpenAI's Codex CLI) as a fourth native agent alongside Stan,
Claude Code, and OpenCode. Runs through Bedrock Mantle's OpenAI-compatible
`/openai/v1` endpoint using the same `bedrock_api_key` secret that OpenCode
and TAU3 already consume.
Changes:
* `run-benchmark.sh`:
- New `codex)` agent case. `CODEX_VERSION` is required (Codex's release
cadence is fast enough that unpinned installs would leave the job name
with an empty `@` segment).
- New `codex)` model-routing case. Only accepts `openai.gpt*` model IDs;
hard-rejects everything else with a clear error (mirrors Claude Code's
Anthropic-only gate).
- New `configure_codex_mantle` function that loads the Bedrock bearer
token and exports it as `OPENAI_API_KEY` alongside
`CODEX_OPENAI_BASE_URL` and `OPENAI_BASE_URL`.
- Mantle URL line in the run summary.
* `run.py`:
- Codex added to `_native_agents`.
- New branch in the env-forwarding block that plumbs `OPENAI_API_KEY` and
`OPENAI_BASE_URL` (from `CODEX_OPENAI_BASE_URL`) into the fleet as
`--ae` templates. Harbor resolves templates at agent construction and
stores references, not secret values, in job config.
* `run-matrix.sh`:
- Codex recognized as a native agent for the `HAS_NATIVE` flag.
- Compatibility check rejects Codex + non-GPT combinations up front, so
matrix runs list them as `INCOMPATIBLE_CELLS` rather than starting a
doomed cell.
- `CODEX_VERSION` gets baked into the matrix state id (`codex@<version>`).
- New usage example.
* `README.md` and `ORCHESTRATOR.md`:
- Agent tables list `codex`.
- `CODEX_VERSION` documented in the env-var table.
- New Codex example under Full examples.
- Native-competitor section describes the Mantle wiring and the GPT-only
constraint.
Harbor's Codex adapter (`harbor.agents.installed.codex:Codex`) is used
unchanged — it already reads `OPENAI_API_KEY`/`OPENAI_BASE_URL` through its
`ModelConnectionSpec(default_provider="openai")`.
Verified with `BENCHMARK_DRY_RUN=1` and `HARBOR_DRY_RUN=1`:
* Valid model: correct job name, correct S3 prefix, correct `harbor run` argv
(with `--ae OPENAI_API_KEY=${OPENAI_API_KEY}` templates).
* Invalid model (non-GPT): rejected with clear error.
* `bash -n` clean; run.py parses under Python 3.12.
Not touched: `run-full-native-suite.sh`'s default `AGENTS="claude-code,opencode"`
— adding Codex silently would kick off unplanned baseline runs. Opt-in.
Follow-up to PR feedback: pin a default version so identical invocations of run-benchmark.sh produce identical Codex CLI installs across runs. Matches the pattern already established for CLAUDE_CODE_VERSION (2.1.220) and OPENCODE_VERSION (1.18.9). Users can still override via the env var. 0.147.0 is the current npm `@openai/codex@latest` stable at PR time.
Author
|
I don't have permission to merge this. 😢 |
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.
Summary
Adds Codex (OpenAI's Codex CLI,
harbor.agents.installed.codex:Codex) as a fourth native agent alongside Stan, Claude Code, and OpenCode. Routes through Bedrock Mantle's OpenAI-compatible/openai/v1endpoint using the samebedrock_api_keysecret OpenCode and TAU3 already consume.The doc's target grid lists GPT-5.6 Sol as one of the six models. Currently the only harness we can run against GPT is OpenCode. This PR unblocks Codex × GPT cells (5 cells against the doc's 5 benchmarks) and makes Codex available for the composite Index as well.
Changes
run-benchmark.sh: newcodex)agent case +codex)model-routing case +configure_codex_mantlefunction.CODEX_VERSIONis required (Codex's release cadence is fast enough that unpinned installs would produce empty@segments in job names). Model gate rejects non-GPT with a clear error, mirroring Claude Code's Anthropic-only gate.run.py: Codex added to_native_agents, plus an env-forwarding branch that plumbsOPENAI_API_KEYandOPENAI_BASE_URL(fromCODEX_OPENAI_BASE_URL) as--aetemplates. Harbor resolves the templates at construction and stores references, not secret values, in job config.run-matrix.sh: Codex recognized as native; compatibility check rejectscodex + non-GPTcells up front so matrix runs list them asINCOMPATIBLE_CELLS;CODEX_VERSIONgets baked into the matrix state id.README.mdandORCHESTRATOR.md: agent tables listcodex, env-var table documentsCODEX_VERSION, new example, native-competitor section describes the Mantle wiring and GPT-only constraint.Harbor's Codex adapter (upstream) is used unchanged — it already reads
OPENAI_API_KEY/OPENAI_BASE_URLviaModelConnectionSpec(default_provider="openai").Not touched
run-full-native-suite.sh— its defaultAGENTS="claude-code,opencode"stays. Adding Codex silently would kick off unplanned baseline runs.Verification
bash -n run-benchmark.shclean;python3.12 ast.parseclean onrun.py.BENCHMARK_DRY_RUN=1 CODEX_VERSION=0.118.0 bash strands-infra-runner/run-benchmark.sh codex openai.gpt-5.6-sol swe-bench/swe-bench-verified 4produces the correct job name, S3 prefix, and Mantle URL.BENCHMARK_DRY_RUN=1 CODEX_VERSION=0.118.0 bash strands-infra-runner/run-benchmark.sh codex sonnet-4.6 …rejects with the expected error.HARBOR_DRY_RUN=1inspection ofrun.pyoutput confirmsharbor runargv includes-a codex -m openai.gpt-5.6-sol --ak version=0.118.0 --ae OPENAI_API_KEY=${OPENAI_API_KEY} --ae OPENAI_BASE_URL=${CODEX_OPENAI_BASE_URL}.Usage
Job name pattern:
codex@<version>--openai.gpt-5.6-sol--<dataset-slug>.Open questions
CODEX_VERSIONrequired rather than defaulting likeCLAUDE_CODE_VERSION=2.1.220andOPENCODE_VERSION=1.18.9. Happy to default to a known-good pin if you have one in mind; I didn't want to guess.run-full-native-suite.sh's default agent list in a follow-up? Not doing that here — separate decision.