-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[fix] Stagehand Agent param is instructions instead of systemPrompt #1212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[fix] Stagehand Agent param is instructions instead of systemPrompt #1212
Conversation
… 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 detectedLatest commit: 1da0d3b The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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.
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
AgentConfiginterface which definessystemPromptas 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
3 files reviewed, no comments
| // // 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. |
There was a problem hiding this comment.
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
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