Skip to content

[STG-1756] add Vertex auth params to Stagehand spec#2118

Merged
monadoid merged 5 commits into
mainfrom
STG-1756
May 20, 2026
Merged

[STG-1756] add Vertex auth params to Stagehand spec#2118
monadoid merged 5 commits into
mainfrom
STG-1756

Conversation

@monadoid
Copy link
Copy Markdown
Contributor

@monadoid monadoid commented May 14, 2026

Why

The generated SDK/OpenAPI surface needs to expose the Vertex service-account auth fields that Stagehand can already pass through.

What changed

  • Add vertex model config fields to the canonical Stagehand Zod schema: project, location, baseURL, and googleAuthOptions.
  • Model googleAuthOptions.credentials as a strict service-account-compatible object requiring client_email and private_key.
  • Omit file-path auth, external credential-source auth, and Vertex Express Mode API-key auth from the AI SDK v5-compatible schema.
  • Regenerate the v3 OpenAPI spec from the Zod source of truth.
  • Add schema tests covering Vertex auth passthrough, minimal credentials, and rejection of unsupported auth shapes.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 14, 2026

🦋 Changeset detected

Latest commit: de277b4

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

This PR includes changesets to release 4 packages
Name Type
@browserbasehq/stagehand Patch
@browserbasehq/stagehand-server-v3 Patch
@browserbasehq/stagehand-evals Patch
@browserbasehq/stagehand-server-v4 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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

✱ Stainless preview builds for stagehand

This PR will update the stagehand SDKs with the following commit message.

feat: STG-1756 add Vertex auth params to Stagehand spec
stagehand-openapi studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅

⚠️ stagehand-typescript studio · conflict

Your SDK build had at least one warning diagnostic.

⚠️ stagehand-python studio · code

Your SDK build had at least one "warning" diagnostic.
generate ⚠️build ✅lint ✅test ✅

pip install https://pkg.stainless.com/s/stagehand-python/2bdeae8adfe292c4bffc8ff93444f5be4c255c2e/stagehand-3.20.0-py3-none-any.whl
stagehand-ruby studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅build ⏭️lint ✅test ✅

⚠️ stagehand-csharp studio · code

Your SDK build had at least one "warning" diagnostic.
generate ⚠️build ✅lint ✅test ✅

stagehand-kotlin studio · conflict

Your SDK build had at least one note diagnostic.

stagehand-java studio · conflict

Your SDK build had at least one note diagnostic.

stagehand-go studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅build ✅lint ✅test ✅

go get github.com/stainless-sdks/stagehand-go@b381980c635b1d7968a2022709fa91921e77556e
⚠️ stagehand-php studio · code

Your SDK build had at least one "warning" diagnostic.
generate ⚠️lint ✅test ✅


This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-05-20 19:18:37 UTC

@monadoid monadoid marked this pull request as ready for review May 15, 2026 12:22
@monadoid monadoid changed the title STG-1756 add Vertex auth params to Stagehand spec [STG-1756] add Vertex auth params to Stagehand spec May 15, 2026
Copy link
Copy Markdown
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 6 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant Client as External Client
    participant API as Stagehand API Server
    participant Schema as Zod Schema Validation
    participant Spec as OpenAPI v3 Spec
    participant SDK as Stagehand SDK
    participant Vertex as Vertex AI Provider

    Note over Client,Vertex: Vertex Auth Configuration Flow

    Client->>API: POST /v3/act or /v3/agent/execute
    Note over Client,API: NEW: includes vertex model config
    
    API->>Schema: validate request body
    Note over Schema: NEW: ModelConfigObjectSchema<br/>includes vertex, project, location,<br/>googleAuthOptions fields

    Schema-->>API: validated ModelConfigObject

    alt Request uses Google Vertex
        API->>SDK: pass ModelConfigObject with vertex fields
        
        SDK->>SDK: construct GoogleVertexProviderSettings
        Note over SDK: NEW: baseURL and full<br/>GoogleVertexAuthOptions included
        
        alt Has apiKey
            SDK->>Vertex: authenticate with Vertex express mode
            Note over SDK,Vertex: uses apiKey from googleAuthOptions
        else Has keyFile or credentials
            SDK->>Vertex: authenticate with service account
            Note over SDK,Vertex: uses keyFilename/keyFile<br/>or credentials object
        end

        Vertex-->>SDK: auth token
        SDK->>Vertex: execute model request with auth
        Vertex-->>SDK: model response
        SDK-->>API: result
    end

    API-->>Client: response with Vertex model results

    Note over Spec,Client: OpenAPI Spec Generation

    API->>Spec: generate OpenAPI v3 spec
    Note over Spec: NEW: GoogleServiceAccountCredentials,<br/>GoogleAuthOptions schemas<br/>added to components
    Note over Spec: NEW: "vertex" added to<br/>provider enum in ModelConfigObject<br/>and ModelConfigObjectOutput
    Spec-->>Client: accessible via /openapi/v3.yaml

    Note over Client,Vertex: Schema Coverage Tests

    Client->>API: act request with full Vertex auth
    Note over Client,API: includes provider:"vertex",<br/>project, location,<br/>googleAuthOptions with apiKey<br/>and credentials

    API->>Schema: validate ActRequestSchema
    Schema-->>API: successfully parsed
    API-->>Client: 200 OK with preserved Vertex config

    Client->>API: agentExecute request with Vertex model config
    Note over Client,API: agentConfig.model and<br/>executionModel both use Vertex

    API->>Schema: validate AgentExecuteRequestSchema
    Schema-->>API: successfully parsed  
    API-->>Client: 200 OK with preserved Vertex config for both models
Loading

Copy link
Copy Markdown
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.

3 issues found across 4 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread packages/core/lib/v3/types/public/api.ts
Comment thread packages/server-v3/openapi.v3.yaml
Comment thread packages/server-v3/openapi.v3.yaml
@monadoid monadoid merged commit 3e95a87 into main May 20, 2026
213 checks passed
@github-actions github-actions Bot mentioned this pull request May 20, 2026
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