Skip to content

Conversation

@miguelg719
Copy link
Collaborator

from #1212 shoutout @bennycortese
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

bennycortese and others added 2 commits November 2, 2025 19:16
…1212)

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

---------

Co-authored-by: Miguel <36487034+miguelg719@users.noreply.github.com>
@changeset-bot
Copy link

changeset-bot bot commented Nov 3, 2025

⚠️ No Changeset found

Latest commit: 9324b82

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

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

This PR updates v3 documentation to fix the agent configuration parameter from instructions to systemPrompt, aligning with the actual API implementation.

Changes Made

  • Updated agent-fallbacks.mdx (1 occurrence)
  • Updated mcp-integrations.mdx (9 occurrences across multiple examples)

Impact

The changes fix a documentation bug that would cause runtime errors for developers following the examples. The parameter name systemPrompt is confirmed correct per the AgentConfig type definition in packages/core/lib/v3/types/public/agent.ts:176.

Confidence Score: 5/5

  • This PR is safe to merge with no risk - it only fixes documentation to match the actual API
  • The changes are purely documentation updates that fix incorrect parameter names. All changes have been verified against the actual TypeScript implementation which confirms systemPrompt is the correct parameter name in AgentConfig
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
packages/docs/v3/best-practices/agent-fallbacks.mdx 5/5 Updated stagehand.agent() parameter from instructions to systemPrompt to match current API
packages/docs/v3/best-practices/mcp-integrations.mdx 5/5 Updated all stagehand.agent() examples (9 instances) from instructions to systemPrompt parameter

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Docs as Documentation
    participant API as Stagehand API
    
    Note over Dev,API: Before PR (Incorrect)
    Dev->>Docs: Read agent documentation
    Docs-->>Dev: Shows instructions parameter
    Dev->>API: agent({ instructions: "..." })
    API-->>Dev: ❌ Error: Parameter not recognized
    
    Note over Dev,API: After PR (Correct)
    Dev->>Docs: Read agent documentation
    Docs-->>Dev: Shows systemPrompt parameter
    Dev->>API: agent({ systemPrompt: "..." })
    API-->>Dev: ✅ Agent created successfully
Loading

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@miguelg719 miguelg719 merged commit 227578a into main Nov 3, 2025
1 check passed
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.

4 participants