work on adding voyager to evals - #959
Conversation
🦋 Changeset detectedLatest commit: 51246f6 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Greptile Summary
This PR adds two industry-standard evaluation suites to benchmark Stagehand's web automation capabilities: WebVoyager (643 test cases) and GAIA (90 test cases). The changes significantly expand the evaluation infrastructure to support data-driven benchmarking against established datasets.
The core architectural change introduces a suite-based evaluation system alongside the existing task-based approach. New suite builders (evals/suites/webvoyager.ts and evals/suites/gaia.ts) read JSONL dataset files and dynamically generate test cases, while corresponding task implementations (evals/tasks/agent/webvoyager.ts and evals/tasks/agent/webarena_gaia.ts) execute the actual evaluations. The system supports flexible sampling strategies using Fisher-Yates shuffle for randomized selection or deterministic first-N selection.
Key infrastructure improvements include:
- A new
core/summary.tsmodule that extracts summary generation logic into a reusable component - Enhanced type system with optional
taskParamsandparamsfields to pass dataset-specific parameters to evaluation functions - New utility functions for JSONL parsing, data validation, and sampling in
evals/utils.ts - Environment variable configuration for controlling test execution (sample sizes, limits, difficulty levels)
- Updated evaluation runner logic in
index.eval.tsto handle both static tasks and dynamic dataset-driven evaluations
The datasets themselves are substantial additions: WebVoyager contains 643 web navigation tasks across 13+ websites (Amazon, Google services, GitHub, etc.), while GAIA provides 90 general AI assistant tasks with varying difficulty levels. Both datasets start from standardized URLs and expect structured response formats.
This integration maintains full backward compatibility with existing evaluations while providing the foundation for systematic benchmarking against industry standards. The sampling capabilities allow for both development testing (small samples) and comprehensive evaluation runs.
Confidence score: 4/5
- This PR is safe to merge with minimal risk as it maintains backward compatibility and adds well-structured evaluation capabilities
- Score reflects solid implementation patterns and comprehensive infrastructure changes, though there's a potential division-by-zero edge case in summary generation
- Pay close attention to
evals/core/summary.tsfor the division-by-zero issue in category success rate calculation
12 files reviewed, 3 comments
Resolved conflicts by merging agent task configurations and including both taskParams and agent properties in StagehandInitResult interface. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Resolved conflicts by merging agent task configurations and including both taskParams and agent properties in StagehandInitResult interface. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add agent evaluation support to CI pipeline
Co-authored-by: Miguel <36487034+miguelg719@users.noreply.github.com>
|
added category to ci for external agent benchmarks: |
| parsedArgs.provider = arg.split("=")[1]?.toLowerCase(); | ||
| } else if (arg.startsWith("--dataset=")) { | ||
| parsedArgs.dataset = arg.split("=")[1]?.toLowerCase(); | ||
| } else if (arg.startsWith("max_k=")) { |
There was a problem hiding this comment.
note for later: we should make this arg a bit more intuitive (along max number of evals or sth)
Co-authored-by: Miguel <36487034+miguelg719@users.noreply.github.com>
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @browserbasehq/stagehand@2.5.0 ### Minor Changes - [#981](#981) [`8244ab2`](8244ab2) Thanks [@sameelarif](https://github.com/sameelarif)! - Added support for `stagehand.agent` to interact with MCP servers as well as custom tools to be passed in. For more information, reference the [MCP integrations documentation](https://docs.stagehand.dev/best-practices/mcp-integrations) ### Patch Changes - [#959](#959) [`09b5e1e`](09b5e1e) Thanks [@filip-michalsky](https://github.com/filip-michalsky)! - add webvoyager evals - [#1049](#1049) [`e3734b9`](e3734b9) Thanks [@miguelg719](https://github.com/miguelg719)! - Support local MCP server connections - [#1025](#1025) [`be85b19`](be85b19) Thanks [@tkattkat](https://github.com/tkattkat)! - add support for custom baseUrl within openai provider - [#1040](#1040) [`88d1565`](88d1565) Thanks [@miguelg719](https://github.com/miguelg719)! - Allow OpenAI CUA to take in an optional baseURL - [#1046](#1046) [`ab5d6ed`](ab5d6ed) Thanks [@tkattkat](https://github.com/tkattkat)! - Add support for gpt-5 in operator agent ## @browserbasehq/stagehand-evals@1.0.9 ### Patch Changes - Updated dependencies \[[`09b5e1e`](09b5e1e), [`e3734b9`](e3734b9), [`8244ab2`](8244ab2), [`be85b19`](be85b19), [`88d1565`](88d1565), [`ab5d6ed`](ab5d6ed)]: - @browserbasehq/stagehand@2.5.0 ## @browserbasehq/stagehand-examples@1.0.9 ### Patch Changes - Updated dependencies \[[`09b5e1e`](09b5e1e), [`e3734b9`](e3734b9), [`8244ab2`](8244ab2), [`be85b19`](be85b19), [`88d1565`](88d1565), [`ab5d6ed`](ab5d6ed)]: - @browserbasehq/stagehand@2.5.0 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @browserbasehq/stagehand@2.5.0 ### Minor Changes - [#981](browserbase/stagehand#981) [`8244ab2`](browserbase/stagehand@8244ab2) Thanks [@sameelarif](https://github.com/sameelarif)! - Added support for `stagehand.agent` to interact with MCP servers as well as custom tools to be passed in. For more information, reference the [MCP integrations documentation](https://docs.stagehand.dev/best-practices/mcp-integrations) ### Patch Changes - [#959](browserbase/stagehand#959) [`09b5e1e`](browserbase/stagehand@09b5e1e) Thanks [@filip-michalsky](https://github.com/filip-michalsky)! - add webvoyager evals - [#1049](browserbase/stagehand#1049) [`e3734b9`](browserbase/stagehand@e3734b9) Thanks [@miguelg719](https://github.com/miguelg719)! - Support local MCP server connections - [#1025](browserbase/stagehand#1025) [`be85b19`](browserbase/stagehand@be85b19) Thanks [@tkattkat](https://github.com/tkattkat)! - add support for custom baseUrl within openai provider - [#1040](browserbase/stagehand#1040) [`88d1565`](browserbase/stagehand@88d1565) Thanks [@miguelg719](https://github.com/miguelg719)! - Allow OpenAI CUA to take in an optional baseURL - [#1046](browserbase/stagehand#1046) [`ab5d6ed`](browserbase/stagehand@ab5d6ed) Thanks [@tkattkat](https://github.com/tkattkat)! - Add support for gpt-5 in operator agent ## @browserbasehq/stagehand-evals@1.0.9 ### Patch Changes - Updated dependencies \[[`09b5e1e`](browserbase/stagehand@09b5e1e), [`e3734b9`](browserbase/stagehand@e3734b9), [`8244ab2`](browserbase/stagehand@8244ab2), [`be85b19`](browserbase/stagehand@be85b19), [`88d1565`](browserbase/stagehand@88d1565), [`ab5d6ed`](browserbase/stagehand@ab5d6ed)]: - @browserbasehq/stagehand@2.5.0 ## @browserbasehq/stagehand-examples@1.0.9 ### Patch Changes - Updated dependencies \[[`09b5e1e`](browserbase/stagehand@09b5e1e), [`e3734b9`](browserbase/stagehand@e3734b9), [`8244ab2`](browserbase/stagehand@8244ab2), [`be85b19`](browserbase/stagehand@be85b19), [`88d1565`](browserbase/stagehand@88d1565), [`ab5d6ed`](browserbase/stagehand@ab5d6ed)]: - @browserbasehq/stagehand@2.5.0 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
⏺ ## Why Add WebVoyager and GAIA evaluation suites to benchmark Stagehand's web navigation and reasoning capabilities against industry-standard datasets. ## What Changed - Added WebVoyager eval suite with 643 test cases for web navigation tasks - Added GAIA eval suite with 90 test cases for general AI assistant tasks - Refactored eval infrastructure to support sampling and filtering - Created reusable utilities for JSONL parsing and test case generation - Added configuration for new eval suites in `evals.config.json` ### Environment Variables - `EVAL_WEBVOYAGER_SAMPLE`: Random sample size from WebVoyager dataset - `EVAL_WEBVOYAGER_LIMIT`: Max cases to run (default: 25) - `EVAL_GAIA_SAMPLE`: Random sample size from GAIA dataset - `EVAL_GAIA_LIMIT`: Max cases to run (default: 25) - `EVAL_GAIA_LEVEL`: Filter GAIA by difficulty level (1, 2, or 3) ### Sampling Strategy The sampling implementation uses Fisher-Yates shuffle for unbiased random selection when `SAMPLE` is specified, otherwise takes the first `LIMIT` cases. This allows for both deterministic (first N) and randomized (sample N) test runs. ## Test Plan ```bash # Test WebVoyager with OpenAI EVAL_SUITE=webvoyager EVAL_WEBVOYAGER_SAMPLE=1 EVAL_MODEL=openai/gpt-4o-computer-use-preview pnpm run evals # Test WebVoyager with Claude EVAL_SUITE=webvoyager EVAL_WEBVOYAGER_SAMPLE=1 EVAL_MODEL=anthropic/claude-3-5-sonnet-20241022 pnpm run evals # Test GAIA with OpenAI EVAL_SUITE=gaia EVAL_GAIA_SAMPLE=1 EVAL_MODEL=openai/gpt-4o-computer-use-preview pnpm run evals # Test GAIA with Claude EVAL_SUITE=gaia EVAL_GAIA_SAMPLE=1 EVAL_MODEL=anthropic/claude-3-5-sonnet-20241022 pnpm run evals # Verify existing evals still work pnpm run evals ``` ---------
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @browserbasehq/stagehand@2.5.0 ### Minor Changes - [browserbase#981](browserbase#981) [`8244ab2`](browserbase@8244ab2) Thanks [@sameelarif](https://github.com/sameelarif)! - Added support for `stagehand.agent` to interact with MCP servers as well as custom tools to be passed in. For more information, reference the [MCP integrations documentation](https://docs.stagehand.dev/best-practices/mcp-integrations) ### Patch Changes - [browserbase#959](browserbase#959) [`09b5e1e`](browserbase@09b5e1e) Thanks [@filip-michalsky](https://github.com/filip-michalsky)! - add webvoyager evals - [browserbase#1049](browserbase#1049) [`e3734b9`](browserbase@e3734b9) Thanks [@miguelg719](https://github.com/miguelg719)! - Support local MCP server connections - [browserbase#1025](browserbase#1025) [`be85b19`](browserbase@be85b19) Thanks [@tkattkat](https://github.com/tkattkat)! - add support for custom baseUrl within openai provider - [browserbase#1040](browserbase#1040) [`88d1565`](browserbase@88d1565) Thanks [@miguelg719](https://github.com/miguelg719)! - Allow OpenAI CUA to take in an optional baseURL - [browserbase#1046](browserbase#1046) [`ab5d6ed`](browserbase@ab5d6ed) Thanks [@tkattkat](https://github.com/tkattkat)! - Add support for gpt-5 in operator agent ## @browserbasehq/stagehand-evals@1.0.9 ### Patch Changes - Updated dependencies \[[`09b5e1e`](browserbase@09b5e1e), [`e3734b9`](browserbase@e3734b9), [`8244ab2`](browserbase@8244ab2), [`be85b19`](browserbase@be85b19), [`88d1565`](browserbase@88d1565), [`ab5d6ed`](browserbase@ab5d6ed)]: - @browserbasehq/stagehand@2.5.0 ## @browserbasehq/stagehand-examples@1.0.9 ### Patch Changes - Updated dependencies \[[`09b5e1e`](browserbase@09b5e1e), [`e3734b9`](browserbase@e3734b9), [`8244ab2`](browserbase@8244ab2), [`be85b19`](browserbase@be85b19), [`88d1565`](browserbase@88d1565), [`ab5d6ed`](browserbase@ab5d6ed)]: - @browserbasehq/stagehand@2.5.0
⏺ ## Why
Add WebVoyager and GAIA evaluation suites to benchmark Stagehand's web navigation and
reasoning capabilities against industry-standard datasets.
What Changed
evals.config.jsonEnvironment Variables
EVAL_WEBVOYAGER_SAMPLE: Random sample size from WebVoyager datasetEVAL_WEBVOYAGER_LIMIT: Max cases to run (default: 25)EVAL_GAIA_SAMPLE: Random sample size from GAIA datasetEVAL_GAIA_LIMIT: Max cases to run (default: 25)EVAL_GAIA_LEVEL: Filter GAIA by difficulty level (1, 2, or 3)Sampling Strategy
The sampling implementation uses Fisher-Yates shuffle for unbiased random selection
when
SAMPLEis specified, otherwise takes the firstLIMITcases. This allows forboth deterministic (first N) and randomized (sample N) test runs.
Test Plan