Skip to content

evals(cua): add a deterministic CUA agent regression task #2188

Closed as not planned

Description

@yawbtng

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 by act/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

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

  1. ferhimedamine commented on Jun 16, 2026

    @ferhimedamine

    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.

  2. yawbtng commented on Jun 22, 2026

    @yawbtng
    ContributorAuthor

    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 extract assertion (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.

  3. Keesan12 commented on Jun 29, 2026

    @Keesan12

    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:

    • which model/provider path was used
    • whether failure happened before or after the browser action
    • whether the regression is in the function-response path or the browser execution path

    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.

  4. yawbtng commented on Jun 30, 2026

    @yawbtng
    ContributorAuthor

    Thanks @Keesan12. Agreed on keeping it narrow — that's the design goal. I put the task up in #2292.

    On attribution, the result records:

    • the model and agent-mode path that ran (modelName / agentMode), so a failure points at a specific provider path
    • whether the agent ever left the start page, which separates "failed before any browser action" (function-response / plumbing) from "acted but landed on the wrong page" (execution)

    The 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.execute logs rather than collapsed into pass/fail, and I'm happy to surface more of it in the result if useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions