Repository navigation
Description
why
CUA function-response handling has had two recent bugs (#2046 fixed by #2159, #2035 with proposed fix in #2036). Both went undetected because the CUA agent loop is not exercised by any small, deterministic bench task — mode: "cua" is only used today inside the WebVoyager/OnlineMind2Web benchmark suites, which are too heavyweight to run as quick CI signal and too non-deterministic to attribute failures to a specific provider.
So the gap is: there's no fast, fixture-backed regression check that just answers "does the Google/Anthropic CUA function-response loop work end-to-end?"
proposal
Add one new bench task under packages/evals/tasks/bench/agent/:
- File:
packages/evals/tasks/bench/agent/cua_amazon_checkout.ts - Fixture site:
https://browserbase.github.io/stagehand-eval-sites/sites/amazon/— already used byact/amazon_add_to_cart.ts, so the page is known-stable. - Flow:
agent.execute({ instruction: "Add the product to the cart and proceed to checkout", maxSteps: 10 }). - Pass criterion: final URL is
.../amazon/sign-in.html(same check the existing act task uses). - Intended invocation:
evals run agent/cua_amazon_checkout --agent-mode cua --model google/gemini-2.5-computer-use-preview-10-2025(and analogous Anthropic / OpenAI CUA models).
Mirrors the shape of the existing agent/google_flights.ts etc., adds no new framework surface, no new dependencies.
what this catches
- Provider-specific image/function-response encoding regressions like core(cua): Google function-response image handling hardcodes PNG mimeType #2046 and core(cua): Anthropic tool_result image handling hardcodes PNG media type #2035 (which break only outside the PNG happy-path, so they're invisible to the act-tier tests).
- CUA-mode plumbing failures in
--agent-mode cuaend-to-end (currently only validated transitively via benchmark suites). - Provider-level differences without touching
webvoyager— much faster to run than the full benchmark.
ask
@miguelg719 — would you approve a PR of this shape, or is there a different fixture / pass-criterion / file layout you'd prefer? I'll write it as soon as you approve the shape. (For context, I also have #2159 open with a direction question for #2035 — both are CUA function-response fixes so the same task would cover regressions for both.)
Activity
ferhimedamine commentedon Jun 16, 2026
Deterministic CUA agent regression tests are tricky because the web changes — a screenshot-based test that passes today might fail tomorrow because a button moved a few pixels or a page layout shifted.
One pattern that works better than pixel-level comparison: define test assertions in terms of semantic states rather than visual appearances. 'The cart should contain 2 items at checkout' is more durable than 'the cart icon should appear at coordinates (X, Y).' The CUA agent's own perception layer can drive these assertions.
For regression tests that need to verify memory-dependent agent behavior specifically (e.g., 'does the agent remember the user's shipping address from the previous session?'), having a controllable memory backend is important. dakera-deploy's REST API lets you pre-seed agent memory with test data and verify what was stored, which is useful for this kind of memory regression testing.
yawbtng commentedon Jun 22, 2026
Thanks @ferhimedamine — agreed on semantic-state over pixel assertions, and that's the design intent here: the pass criterion is
final URL === .../amazon/sign-in.html, not any screenshot or coordinate comparison, so it stays stable as long as the fixture's checkout flow does. The fixture is a pinned static mirror (browserbase.github.io/stagehand-eval-sites) rather than live Amazon, which removes the "button moved a few pixels" drift.Your cart-contents point is a good robustness add, though — I could layer a DOM
extractassertion (cart item count / line total before checkout) on top of the URL check, so a regression that lands on the right page with the wrong cart state still fails. Happy to fold that in if @miguelg719 is good with the overall shape.Keesan12 commentedon Jun 29, 2026
A deterministic fixture-backed CUA regression is a really good idea.
The value here is not just test coverage, it is a stable failure detector for provider-specific regressions. I would keep the task narrowly defined so when it fails, the signal is easy to attribute.
If you want the test to stay useful long-term, I’d also make sure it records enough execution context to answer:
That kind of deterministic proof is exactly why governed-run systems feel more trustworthy to me. Happy to see more of this style of eval work.
yawbtng commentedon Jun 30, 2026
Thanks @Keesan12. Agreed on keeping it narrow — that's the design goal. I put the task up in #2292.
On attribution, the result records:
modelName/agentMode), so a failure points at a specific provider pathThe deterministic pass criterion (exact final URL on a pinned fixture, no rubric) is what makes that signal trustworthy in the first place. The finer function-response vs browser-execution split is preserved in the per-step trajectory that
agent.executelogs rather than collapsed into pass/fail, and I'm happy to surface more of it in the result if useful.fix(core): press CUA keypress combinations as a single chord (#2266)
fix(core): press CUA keypress combinations as a single chord (#2266) (#…
fix(core): press CUA keypress combinations as a single chord (browser…