Repository navigation
Description
Upstream's evals/mcp-tool-use checks how agents use T3's MCP tools, but its runner needs a pay-per-use ANTHROPIC_API_KEY for Claude and a CLIProxyAPI server named vibeproxy for GPT models. Neither exists on openclaw. It also never loads J5's own MCP tools (j5_send_message, j5_propose_crew, playbooks, artifacts), so J5's agent instructions are only half covered. A dry run on 2026-11-06 showed that J5's orchestration text does reach the prompt.
Build a J5-owned eval runner that replays upstream's cases, and J5's own, on the real Claude Code and Codex CLIs, using the subscriptions already signed in. Waits on the next upstream advance (#772), which brings upstream's newer cases, the gradeSample export, and the Terra shell simulator.
Design
- Container: one per run, with pinned Claude Code and Codex versions, an empty home folder, the checkout mounted read-only, and network access only to the model endpoints, through an egress proxy. Each sample gets its own temporary folder and session. Not one container per sample, because one Codex login must not be refreshed by several processes at once.
- Sign-in: Claude uses a long-lived
claude setup-tokentoken passed in asCLAUDE_CODE_OAUTH_TOKEN. Codex uses its owncodex login --device-authin a dedicated volume, never a copy of the host'sauth.json. OpenAI's CI guide says copies break each other when one refreshes. - Harnesses: Claude runs through the Agent SDK on the pinned
claudebinary, with options frommakeClaudeQueryOptions. Codex runs throughcodex app-server --stdio, withdeveloperInstructionsfrombuildCodexAdditionalContext. - Earlier turns: Codex gets them through
thread/inject_items. Claude has no such call, so the runner writes a session file in Claude Code's format and resumes it. That format isn't documented, which makes this the most fragile piece. - Tools: a fake MCP server serves upstream's and J5's real tool schemas from source and answers from the case mocks. A PreToolUse hook on both harnesses rewrites shell and file calls (
updatedInput) so they print the simulator's answer. Anything a hook misses runs inside the container. - Shell simulator:
gpt-6.1-terrain a tool-less Codex thread, on the subscription. - Grading: upstream's case files and
gradeSample. J5's cases go in their own file. Compare only against our own baselines. - Location: a new J5 folder under
evals/, with no edits to upstream files expected. Once it works, record it in Upstream give-back backlog (hold until V2 merges upstream) #276 as a give-back candidate. - Cost: runs use up the same subscription limits as the live fleet. Default concurrency is low, and
--caseand--stop-on-regressionkeep runs small.
First step: a one-case prototype
Run review-round-uses-thread-send on one Claude and one Codex model. It proves:
- a forged Claude session file resumes
thread/inject_itemsis seen as real history- Codex
updatedInputworks on the pinned build ([Feature request] Extend PreToolUse hooks beyond Bash + implement updatedInput rewrite openai/codex#18491 is still open, waiting for live confirmation) - the egress allowlist lets both CLIs work and blocks everything else
- the device-code login leaves the host's Codex login alone
Also measure startup and memory per sample.
Needed from Jackson for the prototype: run claude setup-token once, and enter one device code for the container's Codex login.
Designed with Claude Opus 5.5 in J5 Code.
Activity
Jacksondr5 commentedon Nov 17, 2026
Prototype results (2026-11-16)
The one-case prototype works on both harnesses, and all five proofs hold. The code is in
evals/j5-cli/on branchj5code/find-upstream-instruction-evals. It is not committed yet and edits no upstream file.Pinned versions: Claude Code 2.1.326 and Codex 0.169.0 (the host's versions). Models: Sonnet 5.5 and GPT-6.1 Sol. Each case ran once per harness, and every result below passed.
review-round-uses-thread-send(earlier turns)pr-created-not-linked(shell, then link the PR)The five proofs
delegate_taskwithout loading it first, which the forged history had already done. It also passed on the round 1 findings, which exist only in the forged turns.thread/inject_itemscounts as history. Codex named its callsol-review-r2, after the round 1 callsol-review-r1that exists only in the injected items.updatedInputrewrites shell commands ([Feature request] Extend PreToolUse hooks beyond Bash + implement updatedInput rewrite openai/codex#18491). It also works inside code mode.app-server,--dangerously-bypass-hook-trustis ignored. Unreviewed user hooks don't run there, so the agent'sgit pushran for real, and the egress proxy blocked it./etc/codex/requirements.toml, baked into the image.api.anthropic.com,chatgpt.comandauth.openai.comget through. GitHub, other sites, direct connections and DNS are refused.ab.chatgpt.com(allowed as a subdomain ofchatgpt.com) and*.oaiusercontent.com(refused). Neither refusal affected a turn.claude setup-tokentoken kept outside the repo. Codex uses its own device-code login in thej5-eval-codex-homevolume. Jackson's host Codex login still works.Costs measured
Changes from the design
buildMessages,t3Default,shellRequest,cannedOutputandgradeSample.withProductFieldsandcodexMessagesare still unexported upstream, so they're copied, and the copy is marked as such.makeClaudeQueryOptions. Codex gets J5's turn parameters frombuildCodexTurnStartParamsand its thread config fromCODEX_THREAD_CONFIG.gradeSamplewas already exported before the advance. The earlier note that the advance would bring it was wrong.Known gaps for the full runner
apply_patch, run for real in the throwaway checkout instead of being simulated.endsTurnAfterchecks.feat(evals): run the tool-use evals on the real Claude Code and Codex…
feat(evals): run the tool-use evals on the real Claude Code and Codex…
bryantderosier commentedon Dec 1, 2026
Closing this as done. #1125 shipped it on 2026-11-28; it said "Refs #950", so it didn't close this automatically.
evals/j5-clireplays upstream's cases plus J5's own on the pinned Claude Code (2.1.326) and Codex (0.169.0) CLIs. It runs on the subscription logins, in a Docker container whose only way out is an egress proxy. Claude goes through the Agent SDK with J5'smakeClaudeQueryOptions, and Codex throughcodex app-serverwith J5's turn params. That's the design here and the prototype from the 11-17 comment. J5's own cases are inevals/j5-cli/cases/, andevals/j5-cli/README.mdexplains how to run it.