Skip to content

fix: expose Vertex headers in public model config types#1764

Merged
shrey150 merged 2 commits intomainfrom
codex/fix-vertex-headers-typing
Mar 3, 2026
Merged

fix: expose Vertex headers in public model config types#1764
shrey150 merged 2 commits intomainfrom
codex/fix-vertex-headers-typing

Conversation

@shrey150
Copy link
Copy Markdown
Contributor

@shrey150 shrey150 commented Feb 26, 2026

Summary

  • expose headers on GoogleVertexProviderSettings in Stagehand public model types
  • add a public API type test proving model configs with headers are accepted for google/openai/anthropic
  • add a patch changeset

Context

Runtime already forwards provider options to createVertex(), but TypeScript rejected headers in model config. This aligns public types with runtime behavior.

Validation

  • pnpm -C packages/core run typecheck
  • pnpm -C packages/core run build:esm
  • pnpm -C packages/core run test:core -- packages/core/dist/esm/tests/unit/public-api/llm-and-agents.test.js
  • pnpm -C packages/core run test:core -- packages/core/dist/esm/tests/unit/llm-provider.test.js

Summary by cubic

Expose the headers field on GoogleVertexProviderSettings in the public model config types so custom provider headers (e.g., X-Goog-Priority) are accepted without TypeScript errors. Updated the public API type test to cover Vertex headers and align the model config check with the public API style, keeping types consistent with runtime behavior.

Written for commit bf4907d. Summary will update on new commits. Review in cubic

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 26, 2026

🦋 Changeset detected

Latest commit: bf4907d

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

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

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 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant App as Client Application
    participant Config as ModelConfiguration (Type)
    participant Core as AISdkClient (Stagehand Core)
    participant SDK as AI SDK Provider (Vertex/OpenAI)
    participant API as LLM Backend API (Google/OpenAI)

    Note over App,Config: User defines configuration
    App->>Config: Define modelName & settings
    Note right of Config: CHANGED: GoogleVertexProviderSettings<br/>now exposes 'headers' field

    App->>Core: Initialize Stagehand with config
    
    rect rgb(30, 41, 59)
    Note over Core,SDK: Provider Initialization Flow
    Core->>Core: Extract provider-specific settings
    
    alt Provider is Google Vertex
        Core->>SDK: createVertex({ project, location, headers, ... })
        Note right of Core: NEW: Headers (e.g., X-Goog-Priority)<br/>passed to SDK factory
    else Provider is OpenAI/Anthropic
        Core->>SDK: createOpenAI/Anthropic({ apiKey, headers, ... })
    end
    end

    SDK-->>Core: Return Model Instance

    Note over Core,API: Runtime Request Flow
    App->>Core: act() / observe() / prompt()
    Core->>SDK: Generate request
    SDK->>API: HTTP POST (Request Body)
    Note right of SDK: Includes custom headers<br/>from initial config
    API-->>SDK: Response
    SDK-->>Core: Parsed Result
    Core-->>App: Stagehand Response
Loading

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Feb 26, 2026

Greptile Summary

This PR fixes a TypeScript type mismatch for Google Vertex AI provider by exposing the headers property in GoogleVertexProviderSettings. The runtime already forwarded provider options including headers to createVertex(), but TypeScript was rejecting configs with custom headers like X-Goog-Priority.

Changes:

  • Added "headers" to the Pick type for GoogleVertexProviderSettings in packages/core/lib/v3/types/public/model.ts
  • Added comprehensive type test validating that ModelConfiguration accepts custom headers for Google, OpenAI, and Anthropic providers
  • Included patch changeset documenting the fix

The change is minimal, focused, and properly tested. It aligns the public API types with the existing runtime behavior without introducing any breaking changes.

Confidence Score: 5/5

  • This PR is safe to merge with no risks - it's a minimal type-only fix that aligns TypeScript types with existing runtime behavior.
  • Score reflects that this is a minimal, well-tested type fix with no breaking changes. The change only exposes an existing property that the runtime already supported, and includes proper test coverage and documentation.
  • No files require special attention

Important Files Changed

Filename Overview
.changeset/flat-mice-cheer.md Adds patch changeset documenting the headers exposure in GoogleVertexProviderSettings
packages/core/lib/v3/types/public/model.ts Exposes headers property in GoogleVertexProviderSettings Pick type, aligning TypeScript types with runtime behavior
packages/core/tests/unit/public-api/llm-and-agents.test.ts Adds type test validating that model configs accept custom headers for Google, OpenAI, and Anthropic providers

Last reviewed commit: c7e9266

@shrey150 shrey150 changed the title fix(core): expose Vertex headers in public model config types fix: expose Vertex headers in public model config types Feb 26, 2026
Copy link
Copy Markdown
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.

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link
Copy Markdown
Contributor Author

shrey150 commented Mar 3, 2026

Merge activity

  • Mar 3, 6:29 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Mar 3, 6:30 PM UTC: @shrey150 merged this pull request with Graphite.

@shrey150 shrey150 merged commit 6ba0a1d into main Mar 3, 2026
169 checks passed
miguelg719 pushed a commit that referenced this pull request Mar 18, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @browserbasehq/browse-cli@0.2.0

### Minor Changes

- [#1816](#1816)
[`687d54a`](687d54a)
Thanks [@shrey150](https://github.com/shrey150)! - Add `--context-id`
and `--persist` flags to `browse open` for loading and persisting
Browserbase Contexts across sessions

- [#1793](#1793)
[`e38c13b`](e38c13b)
Thanks [@shrey150](https://github.com/shrey150)! - Initial release of
browse CLI - browser automation for AI agents

### Patch Changes

- [#1806](#1806)
[`f8c7738`](f8c7738)
Thanks [@shrey150](https://github.com/shrey150)! - Fix `browse env`
showing stale mode after `browse env remote`

- Updated dependencies
\[[`505e8c6`](505e8c6),
[`2f43ffa`](2f43ffa),
[`63ee247`](63ee247),
[`7dc35f5`](7dc35f5),
[`335cf47`](335cf47),
[`6ba0a1d`](6ba0a1d),
[`4ff3bb8`](4ff3bb8),
[`c27054b`](c27054b),
[`2abf5b9`](2abf5b9),
[`7817fcc`](7817fcc),
[`7390508`](7390508),
[`611f43a`](611f43a),
[`521a10e`](521a10e),
[`2402a3c`](2402a3c)]:
    -   @browserbasehq/stagehand@3.2.0

## @browserbasehq/stagehand@3.2.0

### Minor Changes

- [#1779](#1779)
[`2f43ffa`](2f43ffa)
Thanks [@shrey150](https://github.com/shrey150)! - feat: add
`cdpHeaders` option to `localBrowserLaunchOptions` for passing custom
HTTP headers when connecting to an existing browser via CDP URL

- [#1834](#1834)
[`63ee247`](63ee247)
Thanks [@tkattkat](https://github.com/tkattkat)! - Update stagehand
agents search tool

- [#1774](#1774)
[`521a10e`](521a10e)
Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - add new
page.setExtraHTTPHeaders() method

### Patch Changes

- [#1759](#1759)
[`505e8c6`](505e8c6)
Thanks [@shrey150](https://github.com/shrey150)! - Add bedrock to the
provider enum in model configuration schemas and regenerate OpenAPI
spec.

- [#1814](#1814)
[`7dc35f5`](7dc35f5)
Thanks [@tkattkat](https://github.com/tkattkat)! - Change usage of
openai provider in agent to default to store:false

- [#1846](#1846)
[`335cf47`](335cf47)
Thanks [@aq17](https://github.com/aq17)! - Fix streaming finished event
being silently dropped. The final SSE event containing the result
payload (success status, message, actions, usage, and messages) was
previously discarded instead of being yielded to the caller.

- [#1764](#1764)
[`6ba0a1d`](6ba0a1d)
Thanks [@shrey150](https://github.com/shrey150)! - Expose `headers` in
`GoogleVertexProviderSettings` so model configs can pass custom provider
headers (for example `X-Goog-Priority`) without TypeScript errors.

- [#1847](#1847)
[`4ff3bb8`](4ff3bb8)
Thanks [@miguelg719](https://github.com/miguelg719)! - Enable FlowLogger
on BROWSERBASE_FLOW_LOGS=1

- [#1752](#1752)
[`c27054b`](c27054b)
Thanks [@derekmeegan](https://github.com/derekmeegan)! - fix: pause
Browserbase agents while captcha solving is active and improve CUA
recovery after the solve completes

- [#1800](#1800)
[`2abf5b9`](2abf5b9)
Thanks [@shrey150](https://github.com/shrey150)! - Make projectId
optional for Browserbase sessions — only BROWSERBASE_API_KEY is required

- [#1766](#1766)
[`7817fcc`](7817fcc)
Thanks [@tkattkat](https://github.com/tkattkat)! - Add configurable
timeout to tools in agent

- [#1749](#1749)
[`7390508`](7390508)
Thanks [@pirate](https://github.com/pirate)! - When connecting to a
browser session that has zero open tabs, Stagehand now automatically
creates an initial `about:blank` tab so the connection can continue.

- [#1761](#1761)
[`611f43a`](611f43a)
Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - fix issue
where handlePossibleNavigation was producing unnecessary error logs on
clicks that trigger page close

- [#1817](#1817)
[`2402a3c`](2402a3c)
Thanks [@tkattkat](https://github.com/tkattkat)! - Add support for
passing custom headers in clientOptions

## @browserbasehq/stagehand-evals@1.1.9

### Patch Changes

- Updated dependencies
\[[`505e8c6`](505e8c6),
[`2f43ffa`](2f43ffa),
[`63ee247`](63ee247),
[`7dc35f5`](7dc35f5),
[`335cf47`](335cf47),
[`6ba0a1d`](6ba0a1d),
[`4ff3bb8`](4ff3bb8),
[`c27054b`](c27054b),
[`2abf5b9`](2abf5b9),
[`7817fcc`](7817fcc),
[`7390508`](7390508),
[`611f43a`](611f43a),
[`521a10e`](521a10e),
[`2402a3c`](2402a3c)]:
    -   @browserbasehq/stagehand@3.2.0

## @browserbasehq/stagehand-server-v3@3.6.1

### Patch Changes

- [#1759](#1759)
[`505e8c6`](505e8c6)
Thanks [@shrey150](https://github.com/shrey150)! - Add bedrock to the
provider enum in model configuration schemas and regenerate OpenAPI
spec.

- Updated dependencies
\[[`505e8c6`](505e8c6),
[`2f43ffa`](2f43ffa),
[`63ee247`](63ee247),
[`7dc35f5`](7dc35f5),
[`335cf47`](335cf47),
[`6ba0a1d`](6ba0a1d),
[`4ff3bb8`](4ff3bb8),
[`c27054b`](c27054b),
[`2abf5b9`](2abf5b9),
[`7817fcc`](7817fcc),
[`7390508`](7390508),
[`611f43a`](611f43a),
[`521a10e`](521a10e),
[`2402a3c`](2402a3c)]:
    -   @browserbasehq/stagehand@3.2.0

## @browserbasehq/stagehand-server-v4@3.6.1

### Patch Changes

- Updated dependencies
\[[`505e8c6`](505e8c6),
[`2f43ffa`](2f43ffa),
[`63ee247`](63ee247),
[`7dc35f5`](7dc35f5),
[`335cf47`](335cf47),
[`6ba0a1d`](6ba0a1d),
[`4ff3bb8`](4ff3bb8),
[`c27054b`](c27054b),
[`2abf5b9`](2abf5b9),
[`7817fcc`](7817fcc),
[`7390508`](7390508),
[`611f43a`](611f43a),
[`521a10e`](521a10e),
[`2402a3c`](2402a3c)]:
    -   @browserbasehq/stagehand@3.2.0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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