Skip to content

feat(integrations): add Grok Build CLI harness - #2876

Closed
antonvishal wants to merge 22 commits into
browserbase:mainfrom
antonvishal:grok-build
Closed

antonvishal wants to merge 22 commits into
browserbase:mainfrom
antonvishal:grok-build

Conversation

@antonvishal

@antonvishal antonvishal commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds the grok_build eval harness using the native Grok Build CLI. Each run uses an isolated Grok home and trusted MCP configuration, with Stagehand browser tools and normalized tool, usage, and completion events.

Partial tool updates remain pending until completion. Wrapped MCP calls retain their actual tool names, arguments, results, and browser evidence. Browser guidance starts with main-frame snapshots and checks every task constraint before the final answer.

Testing

  • evals run b:webvoyager --harness grok_build --tool stagehand_facade -m grok-build/grok-4.6 -l 1 -t 1 -e browserbase runs and passes.
  • 19 targeted tests passed; evals and Grok SDK typechecks passed.

Summary by cubic

Adds a Grok Build integration and eval harness via a new @browserbasehq/stagehand-integrations-grok-build-sdk session adapter that drives the native grok CLI in headless streaming mode over MCP/stdio.

  • Registers the grok_build harness with the stagehand_facade, playwright_mcp, and chrome_devtools_mcp tool surfaces.
  • Runs each eval in an isolated Grok home and workspace, copying cached auth only when XAI_API_KEY is unset and writing the MCP mount into the isolated home's trusted config.
  • Uses the native --rules policy, turn budget, and session-loss handling, and reports usage and cost from the grok CLI stream.
  • Supports --always-approve for unattended runs, configurable via EVAL_GROK_BUILD_ALWAYS_APPROVE.
  • Maps tool, usage, cost, and completion events into the shared verifier trajectory, keeping MCP-wrapped tool names, arguments, results, and browser probe evidence.
  • Distinguishes normal end_turn stops from max-turn stops and process failures so only genuine failures surface as SDK errors.
  • Hardens the ACP lifecycle: passes --max-screenshot-base64-bytes=60000 to the facade spawned by the launcher and marks BROWSERBASE_PROJECT_ID optional.
  • Directs the model to verify every task constraint against observed page data before reporting a final answer.
  • Adds .grok/config.toml, AGENTS.md, docs, and unit tests for the CLI session, runner, and trajectory adapter.

Written for commit 58464db. Summary will update on new commits.

Review in cubic

Resolve overview.mdx conflicts to include both Grok Build and fx
entries. Keep the screenshot base64 budget from browserbase#2791 alongside the
ACP facade launcher changes.

Also pass --max-screenshot-base64-bytes=60000 to the facade spawned by
the ACP launcher so ACP transports get the same frame-cap protection as
fx, mark BROWSERBASE_PROJECT_ID optional in the Grok Build README per
browserbase#2777, and update the affected ACP arg assertions.
@antonvishal
antonvishal requested a review from a team as a code owner September 2, 2026 11:03
@changeset-bot

changeset-bot Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 58464db

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

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run.
Approving the latest commit mirrors it into an internal PR owned by the approver.
If new commits are pushed later, the internal PR stays open but is marked stale until someone approves the latest external commit and refreshes it.

@github-actions github-actions Bot added external-contributor Tracks PRs mirrored from external contributor forks. external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. labels Sep 2, 2026
Comment thread packages/integrations/grok-build-sdk/src/session.ts Outdated
Comment thread packages/integrations/grok-build/AGENTS.md
Comment thread packages/integrations/grok-build/.grok/config.toml
Comment thread packages/integrations/grok-build-sdk/src/index.ts
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

The latest approval by @filip-michalsky could not refresh the mirrored PR automatically (push-failed). The external PR stays open, and the mirrored PR should be updated manually before work continues.

@filip-michalsky

Copy link
Copy Markdown
Collaborator

@antonvishal CI is failing

antonvishal and others added 2 commits October 6, 2026 16:06
The short dependency-wait timeout can abort after fetch has already been sent. That late hit was counted in the next phase and failed TypeScript unit under CI load.

Co-authored-by: Cursor <cursoragent@cursor.com>
@antonvishal

Copy link
Copy Markdown
Contributor Author

@filip-michalsky the CI failure is not related to this PR. So created a separated PR to fix CI.

# Conflicts:
#	packages/evals/package.json
#	pnpm-lock.yaml
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

The latest approval by @miguelg719 could not refresh the mirrored PR automatically (push-failed). The external PR stays open, and the mirrored PR should be updated manually before work continues.

Comment thread .github/workflows/ci.yml
packages/integrations/deepagents-sdk/dist/**
packages/integrations/fx-sdk/dist/**
packages/integrations/cursor-sdk/dist/**
packages/integrations/grok-build-sdk/dist/**

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this blocks the mirror pr @filip-michalsky @antonvishal. closing this one, please reopen without touching .github workflows, we will include this in the mirror pr

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created the new PR: #3120

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

Labels

external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. external-contributor Tracks PRs mirrored from external contributor forks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants