Repository navigation
Eval: Stop a run at a matching tool call, and add skill routing cases - #5287
Merged
Merged
Conversation
A stopAt var ends the run at the first tool call matching a rule (a tool name and optional regexes for its input fields), so a case can judge what the agent did before starting the work without paying for the work. The routing cases use it with a skillsLoadedFirst check: the named skills were loaded before the agent's first call that does the work.
chubes4
marked this pull request as ready for review
October 22, 2026 15:03
Collaborator
📊 Performance Test ResultsComparing f132f9a vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
chubes4
force-pushed
the
studio-code/eval-stop-at
branch
from
October 22, 2026 16:33
8fed58b to
f132f9a
Compare
Contributor
|
The routing cases fail on trunk with Using objects the way |
1 task done
chubes4
added a commit
that referenced
this pull request
Oct 23, 2026
## Related issues - Fixes the routing cases added in #5287, reported by @youknowriad in #5287 (comment). ## Proposed Changes promptfoo expands a var that is an array of plain values into one test per element. The routing cases listed their skills as `skills: [build-site, plugin-recommendations]`, so each ran as one test per skill, and `skillsLoadedFirst` got a string and crashed on `.filter`. Every `routing-*` case failed under `npm run eval`. - `skills` is now a list of objects, `skills: [{ name: build-site }]`, the same shape `followUps`, `answers` and `stopAt` already use, and `skillsLoadedFirst` reads each entry's `name`. - A new test in `outcome.test.mjs` fails when any list var in `promptfoo.config.yaml` holds plain values, so this can't come back for `skills` or a future var. It fails on trunk's config and passes here. - The README documents the shape. A correction to #5287: its testing instructions said `npm run eval -- --filter-pattern "^routing:"` runs the routing cases, and its 69/75 baseline could not have come from that command, since every case crashed under it. The unit test passed the array to the check directly, so it never saw promptfoo's expansion. ## Testing Instructions - `npx vitest run scripts/eval/outcome.test.mjs`: 25 passed. - `STUDIO_EVAL_MODEL=fast npm run eval -- --filter-pattern "^routing:"`: 15 test cases (one per routing case), 14 passed, 8m 34s. The one failure is a real routing miss, not the harness: on `routing-events` the agent loaded `edit-manage-site` and `block-content`, then created the page with plain blocks without loading `plugin-recommendations`. `routing-plan-question` loaded `hosting-plans-helper` first, as in the run on #5287. ## Pre-merge Checklist - [x] Have you checked for TypeScript, React or other console errors? --- AI disclosure: Claude (Anthropic) in the Pi coding agent, via a Roadie session directed by @chubes4, made the change, added the test and ran the evals. @chubes4 reviewed the diff and the run.
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.
Related issues
How AI was used in this PR
Claude (via the Pi coding agent in a Roadie session) wrote the runner change, the check, the cases and their tests, and ran them. I reviewed the diff and the runs.
Proposed Changes
stopAtin the eval runner. It takes a list of rules, each a tool name with optional regexes for the tool's input fields. The run ends at the first tool call that matches a rule, and the result'sstoppedAtnames that call. The matcher is generic data (apps/cli/ai/eval-stop.ts), so it covers any tool, including new or plugin-provided ones, without changes to the runner.skillsLoadedFirstinoutcome.mjs: the skills named in a case'sskillsvar were loaded before the run's stop call. This is the one check judged on the route, not the outcome, because which runbook the agent read is the thing under test. The README says so.routing-*cases, each stopped at the agent's first call that does the work:Write,Edit,generate_images, or awp_clicreate/update/install. The new-site cases also stop atsite_createandscaffold_theme. They cover new sites, plugin features (forms, carousels, newsletters, polls, events), typography and redesigns, sections and template parts, imagery, a layout complaint on a seeded broken homepage, and a plan question. A run costs about 100k tokens and 30 seconds, instead of a full build.Testing Instructions
npx vitest run apps/cli/ai/tests/eval-stop.test.ts scripts/eval/outcome.test.mjsnpm run eval -- --filter-pattern "^routing:"runs the routing cases.Baseline: trunk (
f60de7f0f) passes 69/75, from five runs of each case. Median 116k tokens and about a minute per run, against several minutes and 0.5–3M tokens for a full build case.plugin-recommendations)visual-design)The two weak cases are known gaps on trunk, kept so a fix shows up in the suite.
On Studio Code: List the skills from their own descriptions instead of hand-written routing #5265, these cases showed it wasn't ready: 62/75, mostly runs that loaded neither entry skill (
build-site,edit-manage-site). It also found a skill still pointing at the prompt section Studio Code: List the skills from their own descriptions instead of hand-written routing #5265 removes.Pre-merge Checklist