Skip to content

refactor(evals): target the workspace V4 CLI - #2529

Draft
shrey150 wants to merge 2 commits into
v4-spike-cli-page-runtimefrom
v4-spike-cli-evals-smoke
Draft

refactor(evals): target the workspace V4 CLI#2529
shrey150 wants to merge 2 commits into
v4-spike-cli-page-runtimefrom
v4-spike-cli-evals-smoke

Conversation

@shrey150

@shrey150 shrey150 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make the eval package resolve the workspace browse package so V4 branches test the CLI source under review instead of the published V3 CLI
  • port the core eval adapter to the current command tree, flags, tab result shape, and default JSON output
  • initialize local and Browserbase targets through open about:blank, then reuse a short per-eval session name
  • share the same socket-safe session-name contract across deterministic and prompted eval adapters
  • update harness metadata assertions to use the exact resolved workspace entrypoint

This is the next draft in the CLI migration stack and is based on the screenshot runtime draft.

Contract changes

Surface Contract in this draft
Public CLI commands and result JSON Unchanged
Eval dependency Changes from registry browse@0.9.5 to browse: workspace:*; package version remains 0.9.5
Eval subprocess invocation Uses the CLI's default JSON output and appends --session <name> to each command
Eval startup Uses open about:blank --local or open about:blank --remote; the removed `env local
Coordinate actions Use mouse click, mouse hover, and mouse scroll
Tabs Use tab list, tab new, tab switch, and tab close; list results consume { tabs: [...] } and require stable targetId values
Screenshots Explicitly use --base64 plus current long-form flags
Selector fill Relies on the current no-Enter default instead of the removed --no-press-enter flag
Eval metadata Reports the resolved workspace CLI entrypoint rather than a registry package path
Internal eval session name Deterministic and prompted adapters share one PID/time/random generator capped at 32 characters so temporary daemon paths fit macOS Unix-socket limits

E2E Test Matrix

Command / flow Observed output Confidence / sufficiency
pnpm --filter @browserbasehq/stagehand-evals test:unit 52 files passed; 408 tests passed Proves the adapter mappings, startup selection, socket-safe session names, workspace metadata, and the existing eval framework
pnpm check Formatting, lint, and typecheck completed; 10/10 tasks succeeded Proves the workspace link adds the CLI build to the eval dependency graph and the exact stack passes repository checks
evals run core --tool browse_cli --env local -t 1 -c 2 using the local build 18/18 deterministic tasks passed across actions, forms, navigation, page info, tabs, and viewport Exercises the workspace CLI, local extension bootstrap, V4 runtime, subprocess adapter, and every core capability end to end
Local built CLI with --remote: open a synthetic fixture, click, fill, scroll, evaluate, screenshot, create/list a tab, and stop Remote mode initialized with one page; page state became clicked / hello-v4-remote; scroll moved; screenshot returned 14,440 bytes; tab count became two; cleanup succeeded Proves a real Browserbase browser with the preloaded extension supports the migrated CLI surface; session and target identifiers are omitted
evals run actions/click --tool browse_cli --env browserbase -t 1 -c 1 1/1 task passed; 100% pass rate Proves the eval adapter's Browserbase startup and deterministic action path end to end
Prompted claude_code harness with browse_cli and Browserbase using the local build The browse skill loaded; a real remote V4 daemon started; open, snapshot, click, fill, press, wait, and get commands succeeded; adapter cleanup stopped the daemon. The model later reached its configured turn limit before returning the requested answer Proves prompted harness startup, command routing, V4 browser interaction, and cleanup. It does not prove benchmark-task correctness

No Changeset is included because this remains part of the unreleased V4 spike stack.

@changeset-bot

changeset-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0fffd79

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.

1 participant