Skip to content

feat(vercel): add Stagehand code-mode binding - #92

Closed
shrey150 wants to merge 1 commit into
shrey/stg-2765-v4-tool-bindingsfrom
shrey/stg-2765-vercel-codemode
Closed

feat(vercel): add Stagehand code-mode binding#92
shrey150 wants to merge 1 commit into
shrey/stg-2765-v4-tool-bindingsfrom
shrey/stg-2765-vercel-codemode

Conversation

@shrey150

@shrey150 shrey150 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a native Vercel AI SDK code_execute tool backed by the shared Stagehand executor
  • add an optional ai peer and a dedicated ./ai-sdk package export
  • load the shared Stagehand V4 syntax guide into the example agent's system context
  • add a runnable Vercel AI SDK example, discovery smoke, and isolated CI job

Stack

This PR is stacked on the framework-neutral code-mode tool. Its diff contains only the Vercel AI SDK binding and example.

Lifecycle

One native tool instance owns one executor for the complete generateText call. The example closes that executor in finally, ensuring its Browserbase browser is released whether generation succeeds or fails. The native binding hosts execution directly instead of launching a local MCP subprocess.

E2E Test Matrix

Command / flow Observed output Confidence / sufficiency
pnpm --filter @browserbasehq/stagehand-codemode run build followed by pnpm --filter stagehand-codemode-ai-sdk-example run smoke The local package built its ./ai-sdk export and the example reported Vercel AI SDK native tool binding PASS: code_execute. Proves the example imports the exact local build and receives the expected native tool name, schema, executor callback, and shared syntax guide. It does not make a provider-dependent model request.
pnpm --filter stagehand-codemode-ai-sdk-example run check TypeScript exited successfully. Proves the example compiles against the reviewed local binding and current AI SDK types.
pnpm --filter @browserbasehq/stagehand-codemode run typecheck TypeScript exited successfully. Confirms adding the optional AI SDK export remains compatible with the shared executor and MCP types.
Targeted ESLint and Prettier checks over the package, example, workspace, and workflow Both completed without warnings or formatting differences. Covers the complete changed TypeScript, JavaScript, JSON, YAML, and Markdown surface.

@shrey150
shrey150 force-pushed the shrey/stg-2765-vercel-codemode branch 3 times, most recently from 5e9a9ac to 19047f4 Compare August 4, 2026 22:53
@shrey150
shrey150 force-pushed the shrey/stg-2765-vercel-codemode branch from 19047f4 to 9e423e1 Compare August 4, 2026 23:05
@shrey150

shrey150 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by browserbase/stagehand#2626, which keeps the Vercel AI SDK example beside the canonical MCP build and tests both local and Browserbase startup.

@shrey150 shrey150 closed this Aug 6, 2026
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