Skip to content

Conversation

@bennycortese
Copy link

Stagehand agent no longer directly takes in instructions. It takes in a systemPrompt instead, I noticed this while running npx create-browser-app and seeing the error appear

Fixed this only in the v3 documentation here, but if we are breaking backwards compatibility (I assume probably not), then the following v2 doc files should also be updated:

agent.mdx
agent-fallbacks.mdx
computer-use.mdx
mcp-integrations.mdx
ai-rules.mdx
quickstart.mdx

… a systemPrompt instead, I noticed this while running npx create-browser-app and seeing the error appear. Updated the V3 docs and mcp.ts to account for this
@changeset-bot
Copy link

changeset-bot bot commented Oct 31, 2025

🦋 Changeset detected

Latest commit: 1da0d3b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@browserbasehq/stagehand Patch
@browserbasehq/stagehand-docs Patch
@browserbasehq/stagehand-evals Patch

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

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

Corrects the Stagehand agent parameter name from instructions to systemPrompt across v3 documentation and examples to match the current API.

Changes:

  • Updated commented example code in mcp.ts (1 occurrence)
  • Updated agent fallback documentation example (1 occurrence)
  • Updated MCP integrations documentation with comprehensive changes (10 occurrences across multiple examples)

Impact:

  • Fixes a breaking API inconsistency that would cause runtime errors for users following the v3 documentation
  • Aligns all v3 documentation with the actual AgentConfig interface which defines systemPrompt as the correct parameter
  • No logical errors or security issues introduced

Confidence Score: 5/5

  • Safe to merge - straightforward documentation fix with no code logic changes
  • Simple parameter rename in documentation and commented examples that correctly aligns with the v3 API. No executable code changes, no logical errors, and fixes a critical documentation bug
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
packages/core/examples/mcp.ts 5/5 Updated commented example code from instructions to systemPrompt parameter (line 34)
packages/docs/v3/best-practices/agent-fallbacks.mdx 5/5 Updated documentation example from instructions to systemPrompt parameter (line 33)
packages/docs/v3/best-practices/mcp-integrations.mdx 5/5 Updated all documentation examples (10 occurrences) from instructions to systemPrompt parameter throughout the file

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Code as Codebase
    participant Agent as Stagehand Agent
    
    Note over Dev,Agent: Parameter Rename: instructions → systemPrompt
    
    Dev->>Code: Update mcp.ts example
    Code->>Code: Change instructions to systemPrompt
    
    Dev->>Code: Update agent-fallbacks.mdx
    Code->>Code: Change instructions to systemPrompt
    
    Dev->>Code: Update mcp-integrations.mdx
    Code->>Code: Change instructions to systemPrompt (10 occurrences)
    
    Dev->>Agent: agent({systemPrompt: "..."})
    Agent-->>Dev: ✓ Correct parameter used
    
    Note over Dev,Agent: All v3 docs now use correct API
Loading

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

// // For Anthropic, use claude-sonnet-4-20250514 or claude-3-7-sonnet-latest
// model: "claude-sonnet-4-20250514",
// instructions: `You are a helpful assistant that can use a web browser.
// systemPrompt: `You are a helpful assistant that can use a web browser.
Copy link
Member

Choose a reason for hiding this comment

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

our MCP server is not updated yet but will be soon

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.

2 participants