Skip to content

Conversation

@chrisreadsf
Copy link
Member

why

Currently broken - user spent 3 hours to figure out

what changed

Stagehand Init:

Screenshot 2025-11-07 at 11 19 44

Stagehand Agent:

Screenshot 2025-11-07 at 11 19 58

test plan

@changeset-bot
Copy link

changeset-bot bot commented Nov 7, 2025

⚠️ No Changeset found

Latest commit: 6a1d03b

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

Added warning callouts to notify users that automatic environment variable loading for model API keys is currently broken, providing workaround using explicit model object configuration.

Key Changes:

  • Added prominent warning callout at top of Configuration Setup section
  • Added second warning callout in Agent Models section with CUA-specific example
  • Both warnings include code examples showing model object format with explicit apiKey parameter

Critical Issue:

  • Uses incorrect property name model instead of modelName in all workaround code examples (4 occurrences)
  • This will cause the workaround itself to fail, defeating the purpose of the documentation update

Confidence Score: 0/5

  • This PR cannot be merged as-is - it contains syntax errors that make the documented workaround non-functional
  • Score reflects critical syntax errors in documentation examples. The PR attempts to document a workaround for broken environment variable auto-loading, but uses incorrect property names (model instead of modelName) in all code examples. This will cause users following the documentation to encounter errors, making the problem worse rather than better.
  • packages/docs/v3/configuration/models.mdx requires immediate fixes to all model object property names

Important Files Changed

File Analysis

Filename Score Overview
packages/docs/v3/configuration/models.mdx 1/5 Added warning callouts about broken auto-loading of environment variables, but incorrect property name (model instead of modelName) used in workaround code examples

Sequence Diagram

sequenceDiagram
    participant User
    participant Docs as Documentation
    participant Stagehand as Stagehand Init
    participant Agent as Agent Creation
    
    User->>Docs: Read models.mdx
    Docs-->>User: Warning: Auto env loading broken
    Docs-->>User: Use model object format
    
    User->>Stagehand: new Stagehand({ model: { modelName, apiKey } })
    Stagehand->>Stagehand: Load model config
    Stagehand->>Stagehand: Initialize with explicit API key
    Stagehand-->>User: Initialized
    
    User->>Agent: stagehand.agent({ model: { modelName, apiKey } })
    Agent->>Agent: Load agent model config
    Agent->>Agent: Initialize with explicit API key
    Agent-->>User: Agent ready
Loading

Additional Comments (2)

  1. packages/docs/v3/configuration/models.mdx, line 596-597 (link)

    syntax: property name should be modelName, not model

  2. packages/docs/v3/configuration/models.mdx, line 613-614 (link)

    syntax: property name should be modelName, not model

1 file reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +18 to +19
model: {
model: "google/gemini-2.5-flash",
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: property name should be modelName, not model

Suggested change
model: {
model: "google/gemini-2.5-flash",
modelName: "google/gemini-2.5-flash",
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/docs/v3/configuration/models.mdx
Line: 18:19

Comment:
**syntax:** property name should be `modelName`, not `model`

```suggestion
    modelName: "google/gemini-2.5-flash",
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +490 to +491
model: {
model: "google/gemini-2.5-computer-use-preview-10-2025",
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: property name should be modelName, not model

Suggested change
model: {
model: "google/gemini-2.5-computer-use-preview-10-2025",
modelName: "google/gemini-2.5-computer-use-preview-10-2025",
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/docs/v3/configuration/models.mdx
Line: 490:491

Comment:
**syntax:** property name should be `modelName`, not `model`

```suggestion
    modelName: "google/gemini-2.5-computer-use-preview-10-2025",
```

How can I resolve this? If you propose a fix, please make it concise.

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