Skip to content

feat: record step and tool call counts for eval runs - #278

Merged
mattrossman merged 5 commits into
mainfrom
mattrossman/ai-1199-record-turn-and-tool-call-counts-per-eval-run
Sep 9, 2026
Merged

mattrossman merged 5 commits into
mainfrom
mattrossman/ai-1199-record-turn-and-tool-call-counts-per-eval-run

Conversation

@mattrossman

@mattrossman mattrossman commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

Records stepCount and toolCallCount on each result next to usage and durationMs, so we can compare how many model round trips a harness needs to finish a task. One step is one model response, however many tool calls it carries. See discussion thread for why these are tracked.

// result.json
{
  // ...,
  "stepCount": 13,
  "toolCallCount": 8,
  "durationMs": 60974
}

Where stepCount comes from:

  • Claude Code: num_turns on the final result event
  • OpenCode: number of step_finish records in the stream
  • Codex: number of token_count events in the session rollout under $CODEX_HOME/sessions, since exec --json has no per-response boundary (one per model response)

toolCallCount is the length of the toolCalls list we already parse.

"Step" over "turn" because Codex uses turn for the whole agent response to a prompt, while step is the unit within it in AI SDK and OpenCode.

Sanity checked one eval per harness via the refresh workflow, snapshot here (reverted to keep results out of this PR).

Closes AI-1199

@vercel

vercel Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
evals Ready Ready Preview Sep 9, 2026 9:33pm UTC

Request Review

@mattrossman
mattrossman marked this pull request as ready for review September 9, 2026 21:04
@mattrossman
mattrossman requested a review from a team September 9, 2026 21:04
@mattrossman mattrossman changed the title feat: record turn and tool call counts for eval runs feat: record step and tool call counts for eval runs Sep 9, 2026
@mattrossman

Copy link
Copy Markdown
Collaborator Author

Renamed turns -> steps as mentioned here, also removed the legacy / unused steps: field to avoid confusion.

@mattrossman
mattrossman merged commit 81deca8 into main Sep 9, 2026
9 checks passed
NickLittman added a commit that referenced this pull request Sep 18, 2026
## What's inside

Adds Grok Build, xAI's coding agent, as a fourth CLI harness alongside
Claude Code, Codex and OpenCode.

- ~640 lines of runner + parser, the only files needing real review
(packages/core/src/agents/grok/)
- ~400 lines of parser tests, skimmable
- ~95 lines of experiments and plumbing: grok-4.6, grok-4.6-no-skills,
XAI_API_KEY through the workflow, the registry entry, the web label
- ~17k lines of results data, committed by the bot from two workflow
runs

Grok Build is xAI's coding agent. It calls the xAI API directly, so it
needs XAI_API_KEY rather than the gateway key the other harnesses share.

- GROK_HOME goes in the shell command, not the sandbox env map. docker
exec --env passes values verbatim, so a $HOME in an env value reaches
the CLI unexpanded. The CLI resolves it against the cwd, writes its
config, sessions and binary into a directory named $HOME inside the
scored workspace, and never reads the config.toml we stage. MCP servers
silently fail to connect, and the run scores 0 with an empty report that
looks like a model failure.
- Grok reads .claude/skills natively, but the skills CLI has no grok
agent id and rejects the whole install when one is named.
SKILLS_PATH_BY_AGENT gives grok null, and the claude-code entry
populates the directory it reads. Drop claude-code from that map and
grok loses its skills with nothing failing. Follow-up below.

## Results
- with skills (64/69 - 93%)
- without (58/69 - 84%)

23 benchmark evals × 3 runs on Vercel Sandboxes.

Not comparable to the other rows yet: they were last refreshed on
2026-09-09 (d462078), so they predate #278, #240 and #241, including the
system-prompt removal that #241 calls a scoring change.

## How to review

Needs XAI_API_KEY in .env. Use --concurrency 1 locally; Docker drops
containers under load and reports it as a timeout with a 0 score.

pnpm eval -- --experiment grok-4.6 --eval
resolve-dataapi-001-empty-results

## Follow up tasks

- Split "scope a harness reads" from "--agent ids the CLI accepts" in
SKILLS_PATH_BY_AGENT, so grok declares .claude/skills and a missing
install fails loudly instead of silently.
- Refresh the other five benchmark experiments. Every non-Grok row
predates #278/#240/#241, so the published table currently compares
across harness versions.
- The Grok CLI is pinned to 1.0.13; xAI shipped 12 releases in the
following 12 days. The streaming-json schema is undocumented and its
embedded docs already describe a stream it doesn't emit, so bump
deliberately and re-check the parser against a real transcript.

Ref AI-1143

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rossman <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — dddeb442 Deployed Sep 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants