feat(evals): add stagehand_facade tool surface - #2750
Open
miguelg719 wants to merge 1 commit into
Open
Conversation
|
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 10 files
Architecture diagram
sequenceDiagram
participant Runner as Evals Runner
participant Registry as Core Tool Registry
participant Facade as StagehandFacadeTool
participant Env as buildStagehandFacadeEnv
participant Adapter as Harness Adapter
participant Agent as Agent (Claude/Codex)
participant MCP as MCP Stdio Server
participant Browser as Browser (local/Browserbase)
Note over Runner,Browser: stagehand_facade runtime flow
Runner->>Registry: select tool ("stagehand_facade")
Registry->>Facade: instantiate StagehandFacadeTool
Facade-->>Runner: CoreTool instance
Runner->>Adapter: prepare adapter for tool surface
Adapter->>Facade: start({ environment, startupProfile })
alt LOCAL environment
Adapter->>Facade: startupProfile = "tool_launch_local"
else BROWSERBASE environment
Adapter->>Facade: startupProfile = "tool_create_browserbase"
end
alt startupProfile matches environment
Facade->>Env: buildAllowlistedEnv()
Env-->>Facade: allowlisted STAGEHAND_*/BROWSERBASE_* env
Facade->>Env: force STAGEHAND_BROWSER
Env-->>Facade: browser = "local" OR "browserbase"
Facade->>Facade: create placeholder mount session
Facade-->>Adapter: agentMount config
else startupProfile mismatch
Facade-->>Adapter: throw error
Adapter-->>Runner: startup failed
end
Adapter->>Agent: launch with MCP mount
Agent->>Agent: read FACADE_AGENT_INSTRUCTIONS
Agent->>MCP: spawn stdio-server (node process)
MCP->>Browser: launch/create browser (tool-owned)
MCP-->>Agent: mcp__stagehand__{run,snapshot,screenshot}
Agent->>MCP: run/snapshot/screenshot tool calls
MCP->>Browser: drive browser actions
Browser-->>MCP: execution results
MCP-->>Agent: tool_result stream (source of evidence)
Agent-->>Adapter: agent completes
Adapter->>Adapter: no runner-side captureEvidence
Adapter-->>Runner: results (graded via MCP tool_result)
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
miguelg719
force-pushed
the
harness/facade-surface
branch
from
August 16, 2026 23:54
7b84781 to
dc8ce71
Compare
New via:"mcp" surface whose mount spawns the shipped facade stdio server (@browserbasehq/stagehand-integrations/facade/stdio-server) with an allowlisted STAGEHAND_*/BROWSERBASE_* env and the canonical FACADE_AGENT_INSTRUCTIONS. Evals now benchmarks the byte-identical surface the claude-code/codex/pi integrations ship, alongside stagehand_code rather than replacing it. The facade server owns its browser (tool_launch_local / tool_create_browserbase profiles); no runner-side captureEvidence — verification relies on the tool_result stream, matching the other external-MCP surfaces.
miguelg719
force-pushed
the
harness/facade-surface
branch
from
August 17, 2026 18:45
dc8ce71 to
afa7bbb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on the codex-sdk extraction PR. Part 4 (final) of the harness consolidation stack — this closes the loop: evals now benchmarks the byte-identical facade surface the claude-code/codex/pi integrations ship.
What
New
via:"mcp"tool surfacestagehand_facade: the mount spawns the shipped facade stdio server (@browserbasehq/stagehand-integrations/facade/stdio-server) with an allowlistedSTAGEHAND_*/BROWSERBASE_*env (browser selection forced to match the eval environment) andFACADE_AGENT_INSTRUCTIONSby identity. Registered for both external harnesses, selectable alongsidestagehand_code(not replacing it). The facade server owns its browser (tool_launch_local/tool_create_browserbase); evidence semantics match the other external-MCP surfaces (verification via the tool_result stream). Also ignores evals run artifacts (.trajectories/, rubric cache) — generated output with session IDs that was dirtying trees.Verification
evals run b:webvoyager --harness claude_code --tool stagehand_facade -l 1 -e browserbase→ 3/3 trials complete, agents drovemcp__stagehand__{run,snapshot,screenshot}, 2/3 graded pass, 0/12 criteria unverifiable (better verifiability than the handles surface)Summary by cubic
Adds
stagehand_facade, an MCP tool surface that launches the shipped facade stdio server so evals benchmark the exact surface our integrations ship. Previouslystagehand_codeor attachable MCP tools were available; now the facade owns its browser and verification uses thetool_resultstream, with the runner session a no-op.stagehand_facadein the core registry and in theclaude_codeandcodexadapters; defaults totool_launch_localortool_create_browserbaseby environment.@browserbasehq/stagehand-integrations/facade/stdio-serverwithFACADE_AGENT_INSTRUCTIONSand the allowlisted env from@browserbasehq/stagehand-integrations/harness; forcesSTAGEHAND_BROWSERper environment and excludes non-allowlisted secrets.captureEvidence; sets metadata (browserOwnership "tool", connection mode) from the startup profile.stagehand_facade; adds tests covering registration, MCP mount shape, env filtering, and startup profile resolution.Written for commit afa7bbb. Summary will update on new commits.