fix: expose Vertex headers in public model config types#1764
Conversation
🦋 Changeset detectedLatest commit: bf4907d The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
There was a problem hiding this comment.
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
Greptile SummaryThis PR fixes a TypeScript type mismatch for Google Vertex AI provider by exposing the Changes:
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
Important Files Changed
Last reviewed commit: c7e9266 |
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>
Summary
headersonGoogleVertexProviderSettingsin Stagehand public model typesContext
Runtime already forwards provider options to
createVertex(), but TypeScript rejectedheadersin model config. This aligns public types with runtime behavior.Validation
pnpm -C packages/core run typecheckpnpm -C packages/core run build:esmpnpm -C packages/core run test:core -- packages/core/dist/esm/tests/unit/public-api/llm-and-agents.test.jspnpm -C packages/core run test:core -- packages/core/dist/esm/tests/unit/llm-provider.test.jsSummary 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