Skip to content

Conversation

@ell-hol
Copy link

@ell-hol ell-hol commented Dec 19, 2025

why

model was unavailable in the sdk

what changed

model is now available to use in the sdk

test plan

the existing tests should pass, no mod needed


Summary by cubic

Adds support for Gemini 3 preview models so they can be selected and used across the SDK and server. Maps both models to the Google provider with no breaking changes.

  • New Features
    • Added "gemini-3-flash-preview" and "gemini-3-pro-preview" to AvailableModel and server legacy model types.
    • Mapped both models to the Google provider in core and server utilities.
    • Included both models in the evals model list.

Written for commit de14472. Summary will update automatically on new commits.

@changeset-bot
Copy link

changeset-bot bot commented Dec 19, 2025

⚠️ No Changeset found

Latest commit: de14472

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

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 13 files

Architecture diagram
sequenceDiagram
    participant Client
    participant SDK as "Stagehand / Server"
    participant Mapper as "Model Provider Map"
    participant Google as "Google API"

    Note over Client,Google: NEW: Support for Gemini 3 Preview Models

    Client->>SDK: Initialize { model: "gemini-3-flash-preview" }
    
    SDK->>Mapper: Map model string to provider
    
    alt NEW: Model Resolution
        Mapper->>Mapper: Lookup "gemini-3-flash-preview"
        Note right of Mapper: CHANGED: Resolves to "google"\n(previously undefined)
    end
    
    Mapper-->>SDK: Provider: "google"
    
    SDK->>SDK: Load Credentials (GOOGLE_GENERATIVE_AI_API_KEY)
    
    Client->>SDK: Execute LLM Task (eval or agent)
    
    SDK->>Google: API Request (model="gemini-3-flash-preview")
    Note right of Google: External call to\nnew preview model
    Google-->>SDK: Response
    
    SDK-->>Client: Result
Loading

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 19, 2025

Greptile Summary

Added support for two new Gemini 3 preview models (gemini-3-flash-preview and gemini-3-pro-preview) across the SDK and server components. The models are properly mapped to the Google provider in all relevant locations.

Key Changes:

  • Added model type definitions in core and server type systems
  • Mapped both models to Google provider in LLMProvider and server utilities
  • Included models in evaluation configuration
  • Applied minor code style improvements (removed unnecessary parentheses around nullish coalescing operators)

Critical Issue:

  • The pnpm-lock.yaml file was deleted, which will cause dependency resolution issues for anyone cloning or pulling this branch. This needs to be regenerated immediately with pnpm install.

Confidence Score: 3/5

  • This PR has a critical issue with the deleted lockfile that must be resolved before merging
  • The model additions are implemented correctly and consistently across all necessary files. However, the deletion of pnpm-lock.yaml is a critical issue that will break dependency resolution for the project. The formatting changes are cosmetic and safe.
  • pnpm-lock.yaml requires immediate attention - it needs to be regenerated with pnpm install before this PR can be merged

Important Files Changed

Filename Overview
packages/core/lib/v3/types/public/model.ts Added gemini-3-flash-preview and gemini-3-pro-preview model types to AvailableModel union
packages/core/lib/v3/llm/LLMProvider.ts Mapped both new Gemini 3 models to google provider in modelToProviderMap
packages/server/src/types/model.ts Added gemini-3-flash-preview and gemini-3-pro-preview to LegacyModel type
packages/server/src/lib/utils.ts Added mapping cases for new Gemini 3 models to return google provider
packages/evals/taskConfig.ts Added gemini-3-flash-preview and gemini-3-pro-preview to ALL_EVAL_MODELS list
pnpm-lock.yaml Lockfile deleted (entire file removed, 12647 lines)

Sequence Diagram

sequenceDiagram
    participant User
    participant Stagehand as Stagehand SDK
    participant LLMProvider
    participant ModelMap as modelToProviderMap
    participant GoogleClient
    participant GoogleAPI as Google Gemini API

    User->>Stagehand: Initialize with model: "gemini-3-flash-preview"
    Stagehand->>LLMProvider: getClient("gemini-3-flash-preview")
    LLMProvider->>ModelMap: Lookup provider for model
    ModelMap-->>LLMProvider: Returns "google"
    LLMProvider->>GoogleClient: Create GoogleClient instance
    GoogleClient-->>LLMProvider: Return client
    LLMProvider-->>Stagehand: Return GoogleClient
    Stagehand->>GoogleClient: Make LLM request
    GoogleClient->>GoogleAPI: API call with gemini-3-flash-preview
    GoogleAPI-->>GoogleClient: Model response
    GoogleClient-->>Stagehand: Return response
    Stagehand-->>User: Return result
Loading

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.

Additional Comments (1)

  1. pnpm-lock.yaml

    logic: pnpm-lock.yaml deleted - this will cause dependency resolution issues and should be regenerated with pnpm install

12 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@miguelg719
Copy link
Collaborator

hey @ell-hol have you tried passing the model as google/gemini-3-flash-preview? We're migrating form the legacy single model strings to this provider/model format

@ell-hol
Copy link
Author

ell-hol commented Dec 19, 2025

@miguelg719 it should work but I haven't been able to test locally (not enough memory to build)

Copy link
Member

@pirate pirate left a comment

Choose a reason for hiding this comment

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

approve but try and undo all those parens removals before merging

Copy link
Member

@pirate pirate left a comment

Choose a reason for hiding this comment

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

see earlier comments, remove the lockfile changes and formatting changes

@miguelg719
Copy link
Collaborator

FYI gemini 3 flash has specific inference configs that seem to improve performance, we might make these the default for it after some testing

@ell-hol ell-hol requested a review from pirate December 20, 2025 12:35
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.

3 participants