Conversation
🦋 Changeset detectedLatest commit: 19e7a24 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 |
✱ Stainless preview builds for stagehandThis PR will update the
|
There was a problem hiding this comment.
No issues found across 15 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 API Client
participant Server as Fastify Server
participant Header as getRequestModelConfig()
participant Store as InMemorySessionStore
participant LLM as LLMProvider
participant AI as @ai-sdk/azure
Note over Client,AI: Azure Entra ID model auth flow
Client->>Server: POST /act (or /agent/execute)
Server->>Header: Parse model config from body + headers
Header->>Header: Extract model field & x-model-api-key header
alt Azure Entra model config provided
Header->>Header: Read auth.type === "azureEntraId"
Header-->>Server: RequestModelConfig { model, apiKey: header fallback }
else Generic model config
Header->>Header: Fallback to apiKey from body or header
Header-->>Server: RequestModelConfig { apiKey, model }
end
Server->>Store: initSession(options)
Store->>Store: withModelApiKeyFallback(model, ctx.modelApiKey)
alt Model has provider auth (e.g., azureEntraId)
Store->>Store: Return model as-is, no apiKey merge
else Model has own apiKey
Store->>Store: Return model as-is, no apiKey merge
else Model missing apiKey + header key present
Store->>Store: Return { ...model, apiKey: headerKey }
end
Store-->>Server: V3Options with model config
Server->>LLM: getClient(modelName, clientOptions)
LLM->>LLM: toAISDKClientOptions(subProvider, options)
alt subProvider === "azure"
LLM->>LLM: Extract { auth, providerOptions.azure }
alt auth.type === "azureEntraId"
LLM->>LLM: Build tokenProvider: async () => auth.token
LLM-->>AI: tokenProvider function
end
LLM-->>LLM: Spread azure provider options (resourceName, apiVersion, etc.)
else subProvider === "vertex"
LLM->>LLM: Build googleAuth from credentials
LLM-->>AI: Vertex client with auth
else generic provider
LLM-->>AI: Pass clientOptions as-is
end
LLM-->>Server: AISDKProviderClientOptions
Server->>AI: Create Azure OpenAI client with tokenProvider
AI-->>Server: SDK client instance
Server->>AI: Execute model request (chat completion)
alt Success
AI-->>Server: Model response
Server-->>Client: Action result
else Auth failure (invalid token)
AI-->>Server: 401 / auth error
Server-->>Client: Error response
end
There was a problem hiding this comment.
2 issues found across 6 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
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/stagehand@3.6.0 ### Minor Changes - [#2178](#2178) [`c49a3fc`](c49a3fc) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - add support for WebMCP ### Patch Changes - [#2217](#2217) [`147e310`](147e310) Thanks [@monadoid](https://github.com/monadoid)! - Add Azure OpenAI Microsoft Entra ID model auth support. - [#2231](#2231) [`cf3603d`](cf3603d) Thanks [@miguelg719](https://github.com/miguelg719)! - Add claude-fable-5 support: native structured outputs via the @ai-sdk/anthropic bump, adaptive thinking (including the new "xhigh" effort) on the agent path, the API's built-in server-side refusal fallback to claude-opus-4-8, and auto tool choice for the final done call on models that reject forced tool use. - [#2233](#2233) [`8d7d414`](8d7d414) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - Normalize URLs in `ActCache` key derivation by sorting query parameters before hashing. Semantically equivalent URLs that differ only in parameter order (e.g. `?utm_source=email&id=42` vs `?id=42&utm_source=email`) now hit the cache instead of silently missing. Fragments and duplicate keys are preserved. - [#2229](#2229) [`fd42e65`](fd42e65) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - launch local browser with --enable-features=WebMCPTesting,DevToolsWebMCPSupport by default - [#2220](#2220) [`a64c6b7`](a64c6b7) Thanks [@monadoid](https://github.com/monadoid)! - Fix Stagehand-generated shadow-root XPath resolution so deterministic actions can target elements inside web components. - [#2132](#2132) [`ed3e566`](ed3e566) Thanks [@miguelg719](https://github.com/miguelg719)! - Add canonical verifier evidence normalization for screenshots and text signals without requiring image dependencies in core installs. - [#2133](#2133) [`840aac8`](840aac8) Thanks [@miguelg719](https://github.com/miguelg719)! - Add the rubric-based verifier engine with normalized public rubric output and bounded failure-step parsing. ## @browserbasehq/stagehand-evals@2.0.3 ### Patch Changes - Updated dependencies \[[`147e310`](147e310), [`cf3603d`](cf3603d), [`8d7d414`](8d7d414), [`fd42e65`](fd42e65), [`a64c6b7`](a64c6b7), [`c49a3fc`](c49a3fc), [`ed3e566`](ed3e566), [`840aac8`](840aac8)]: - @browserbasehq/stagehand@3.6.0 ## @browserbasehq/stagehand-server-v3@3.7.1 ### Patch Changes - [#2217](#2217) [`147e310`](147e310) Thanks [@monadoid](https://github.com/monadoid)! - Add Azure OpenAI Microsoft Entra ID model auth support. - Updated dependencies \[[`147e310`](147e310), [`cf3603d`](cf3603d), [`8d7d414`](8d7d414), [`fd42e65`](fd42e65), [`a64c6b7`](a64c6b7), [`c49a3fc`](c49a3fc), [`ed3e566`](ed3e566), [`840aac8`](840aac8)]: - @browserbasehq/stagehand@3.6.0 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
## Why The `stagehand-server-v3` SEA binary release workflow (`.github/workflows/stagehand-server-v3-release.yml`) only cuts a new tag/binary build when a changeset added since the last `stagehand-server-v3/v*` tag explicitly lists the `@browserbasehq/stagehand-server-v3` package. It doesn't look at `package.json` versions. The last such changeset landed on 2026-06-09 (v3.7.2, #2217). Since then, 39 changesets have merged that touch `packages/core`/`packages/server-v3` — including Gemini 3.5 Flash CUA support (#2273) and an AI SDK warning fix affecting act/extract/observe (#2359) — and none of them included the `stagehand-server-v3` package line. So the release-detect job has returned `release=false` on every push for over a month, even though `updateInternalDependencies: patch` cosmetically bumps server-v3's `package.json`/CHANGELOG on every Version Packages PR, making it look like a release happened when it didn't. This changeset is a one-time catch-up: it doesn't change any code, it just gives the release workflow a qualifying trigger so it cuts a binary build containing everything already merged to `packages/core` since v3.7.2. Related: a user asked about this gap on Discord, referencing #2333 (Gemini 3.5 Flash support request). ## What changed - Added `.changeset/stagehand-server-v3-catchup-release.md` bumping `@browserbasehq/stagehand-server-v3` (patch, 3.7.2 → 3.7.3). ## E2E Test Matrix | Command / flow | Observed output | Confidence / sufficiency | | --- | --- | --- | | Ran the exact front-matter regex from `stagehand-server-v3-release.yml`'s `detect` job against the new changeset file | `Parsed: @browserbasehq/stagehand-server-v3 patch matches target package: true` | Proves this changeset satisfies the workflow's own detection logic and will set `release=true` on merge to main, advancing the tag from `v3.7.2` to `v3.7.3`. | | Verified all 13 historical `stagehand-server-v3` tags against their triggering commit's changeset | 13/13 correlate exactly with a changeset explicitly bumping `@browserbasehq/stagehand-server-v3` | Confirms the detection mechanism is real and consistent — this isn't a guess about how the pipeline works. | | Scanned all 39 changesets added to main since the `v3.7.2` tag commit | 0/39 include a `stagehand-server-v3` line | Confirms the gap is total (not partial) and this PR is the correct/only trigger needed. | Linear: [STG-2587](https://linear.app/browserbase/issue/STG-2587/cut-a-stagehand-server-v3-release-to-catch-up-on-binary-drift-since) <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Triggers a catch-up SEA binary release for `@browserbasehq/stagehand-server-v3` by adding a changeset, so all core changes since v3.7.2 ship (including Gemini 3.5 Flash computer-use support). Addresses Linear STG-2587 by closing the drift between version bumps and actual binary releases. <sup>Written for commit efb5f99. Summary will update on new commits.</sup> <a href="https://cubic.dev/pr/browserbase/stagehand/pull/2367?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
## Why
Support Azure OpenAI Microsoft Entra ID bearer-token auth through the
Stagehand model config shape.
## What changed
- Adds an explicit Azure model config branch with `auth: { type:
"azureEntraId", token }` and `providerOptions.azure`.
- Adapts Azure Entra auth to the AI SDK Azure `tokenProvider` option.
- Bumps `@ai-sdk/azure` to the v5-compatible release with
`tokenProvider` support.
- Regenerates the server-v3 OpenAPI spec and adds parser/schema/runtime
tests.
## Validation
- `pnpm --filter @browserbasehq/stagehand run build:esm`
- `pnpm --filter @browserbasehq/stagehand run test:core --
packages/core/dist/esm/tests/unit/llm-provider.test.js
packages/core/dist/esm/tests/unit/api-variables-schema.test.js
packages/core/dist/esm/tests/unit/public-api/llm-and-agents.test.js`
- `pnpm --filter @browserbasehq/stagehand-server-v3 run gen:openapi`
- `pnpm --filter @browserbasehq/stagehand-server-v3 run build:esm-tests`
- `pnpm --filter @browserbasehq/stagehand-server-v3 run test:server --
packages/server-v3/dist/tests/unit/requestModelConfig.test.js`
- `pnpm --filter @browserbasehq/stagehand run typecheck`
- `pnpm --filter @browserbasehq/stagehand-server-v3 run typecheck`
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds Azure OpenAI Microsoft Entra ID bearer-token auth to Stagehand.
Implements STG-2090 and updates types, schemas, and OpenAPI to support
the new `azure` provider.
- **New Features**
- Add `provider: "azure"` with `auth: { type: "azureEntraId", token }`
and `providerOptions.azure` (resourceName, baseURL, apiVersion,
useDeploymentBasedUrls, headers).
- Map Entra auth to the `@ai-sdk/azure` `tokenProvider`; Azure runs
without experimental mode and never sends an API key when provider auth
is set.
- Preserve same-provider non-credential options when overriding
credentials (inherit baseURL/headers/providerOptions; strip
`apiKey`/`auth`) across client and server.
- Prevent API key fallback when provider auth exists: ignore
env/header/base-config keys, keep per-request Azure configs via
`withModelApiKeyFallback`, and reject configs that mix `apiKey` with
Entra auth.
- Expand public types and Zod schemas (add `AgentType: "azure"`);
regenerate OpenAPI with Azure schemas and normalize the generator output
to preserve Azure union branches.
- Add unit tests for schema validation, AI SDK client options, API
client defaults, server request model config parsing, and tokenProvider
behavior.
- **Dependencies**
- Bump `@ai-sdk/azure` to `^2.0.109`.
<sup>Written for commit 19e7a24.
Summary will update on new commits.</sup>
<a
href="https://cubic.dev/pr/browserbase/stagehand/pull/2217?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
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/stagehand@3.6.0 ### Minor Changes - [browserbase#2178](browserbase#2178) [`c49a3fc`](browserbase@c49a3fc) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - add support for WebMCP ### Patch Changes - [browserbase#2217](browserbase#2217) [`147e310`](browserbase@147e310) Thanks [@monadoid](https://github.com/monadoid)! - Add Azure OpenAI Microsoft Entra ID model auth support. - [browserbase#2231](browserbase#2231) [`cf3603d`](browserbase@cf3603d) Thanks [@miguelg719](https://github.com/miguelg719)! - Add claude-fable-5 support: native structured outputs via the @ai-sdk/anthropic bump, adaptive thinking (including the new "xhigh" effort) on the agent path, the API's built-in server-side refusal fallback to claude-opus-4-8, and auto tool choice for the final done call on models that reject forced tool use. - [browserbase#2233](browserbase#2233) [`8d7d414`](browserbase@8d7d414) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - Normalize URLs in `ActCache` key derivation by sorting query parameters before hashing. Semantically equivalent URLs that differ only in parameter order (e.g. `?utm_source=email&id=42` vs `?id=42&utm_source=email`) now hit the cache instead of silently missing. Fragments and duplicate keys are preserved. - [browserbase#2229](browserbase#2229) [`fd42e65`](browserbase@fd42e65) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - launch local browser with --enable-features=WebMCPTesting,DevToolsWebMCPSupport by default - [browserbase#2220](browserbase#2220) [`a64c6b7`](browserbase@a64c6b7) Thanks [@monadoid](https://github.com/monadoid)! - Fix Stagehand-generated shadow-root XPath resolution so deterministic actions can target elements inside web components. - [browserbase#2132](browserbase#2132) [`ed3e566`](browserbase@ed3e566) Thanks [@miguelg719](https://github.com/miguelg719)! - Add canonical verifier evidence normalization for screenshots and text signals without requiring image dependencies in core installs. - [browserbase#2133](browserbase#2133) [`840aac8`](browserbase@840aac8) Thanks [@miguelg719](https://github.com/miguelg719)! - Add the rubric-based verifier engine with normalized public rubric output and bounded failure-step parsing. ## @browserbasehq/stagehand-evals@2.0.3 ### Patch Changes - Updated dependencies \[[`147e310`](browserbase@147e310), [`cf3603d`](browserbase@cf3603d), [`8d7d414`](browserbase@8d7d414), [`fd42e65`](browserbase@fd42e65), [`a64c6b7`](browserbase@a64c6b7), [`c49a3fc`](browserbase@c49a3fc), [`ed3e566`](browserbase@ed3e566), [`840aac8`](browserbase@840aac8)]: - @browserbasehq/stagehand@3.6.0 ## @browserbasehq/stagehand-server-v3@3.7.1 ### Patch Changes - [browserbase#2217](browserbase#2217) [`147e310`](browserbase@147e310) Thanks [@monadoid](https://github.com/monadoid)! - Add Azure OpenAI Microsoft Entra ID model auth support. - Updated dependencies \[[`147e310`](browserbase@147e310), [`cf3603d`](browserbase@cf3603d), [`8d7d414`](browserbase@8d7d414), [`fd42e65`](browserbase@fd42e65), [`a64c6b7`](browserbase@a64c6b7), [`c49a3fc`](browserbase@c49a3fc), [`ed3e566`](browserbase@ed3e566), [`840aac8`](browserbase@840aac8)]: - @browserbasehq/stagehand@3.6.0
## Why The `stagehand-server-v3` SEA binary release workflow (`.github/workflows/stagehand-server-v3-release.yml`) only cuts a new tag/binary build when a changeset added since the last `stagehand-server-v3/v*` tag explicitly lists the `@browserbasehq/stagehand-server-v3` package. It doesn't look at `package.json` versions. The last such changeset landed on 2026-06-09 (v3.7.2, browserbase#2217). Since then, 39 changesets have merged that touch `packages/core`/`packages/server-v3` — including Gemini 3.5 Flash CUA support (browserbase#2273) and an AI SDK warning fix affecting act/extract/observe (browserbase#2359) — and none of them included the `stagehand-server-v3` package line. So the release-detect job has returned `release=false` on every push for over a month, even though `updateInternalDependencies: patch` cosmetically bumps server-v3's `package.json`/CHANGELOG on every Version Packages PR, making it look like a release happened when it didn't. This changeset is a one-time catch-up: it doesn't change any code, it just gives the release workflow a qualifying trigger so it cuts a binary build containing everything already merged to `packages/core` since v3.7.2. Related: a user asked about this gap on Discord, referencing browserbase#2333 (Gemini 3.5 Flash support request). ## What changed - Added `.changeset/stagehand-server-v3-catchup-release.md` bumping `@browserbasehq/stagehand-server-v3` (patch, 3.7.2 → 3.7.3). ## E2E Test Matrix | Command / flow | Observed output | Confidence / sufficiency | | --- | --- | --- | | Ran the exact front-matter regex from `stagehand-server-v3-release.yml`'s `detect` job against the new changeset file | `Parsed: @browserbasehq/stagehand-server-v3 patch matches target package: true` | Proves this changeset satisfies the workflow's own detection logic and will set `release=true` on merge to main, advancing the tag from `v3.7.2` to `v3.7.3`. | | Verified all 13 historical `stagehand-server-v3` tags against their triggering commit's changeset | 13/13 correlate exactly with a changeset explicitly bumping `@browserbasehq/stagehand-server-v3` | Confirms the detection mechanism is real and consistent — this isn't a guess about how the pipeline works. | | Scanned all 39 changesets added to main since the `v3.7.2` tag commit | 0/39 include a `stagehand-server-v3` line | Confirms the gap is total (not partial) and this PR is the correct/only trigger needed. | Linear: [STG-2587](https://linear.app/browserbase/issue/STG-2587/cut-a-stagehand-server-v3-release-to-catch-up-on-binary-drift-since) <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Triggers a catch-up SEA binary release for `@browserbasehq/stagehand-server-v3` by adding a changeset, so all core changes since v3.7.2 ship (including Gemini 3.5 Flash computer-use support). Addresses Linear STG-2587 by closing the drift between version bumps and actual binary releases. <sup>Written for commit efb5f99. Summary will update on new commits.</sup> <a href="https://cubic.dev/pr/browserbase/stagehand/pull/2367?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
Why
Support Azure OpenAI Microsoft Entra ID bearer-token auth through the Stagehand model config shape.
What changed
auth: { type: "azureEntraId", token }andproviderOptions.azure.tokenProvideroption.@ai-sdk/azureto the v5-compatible release withtokenProvidersupport.Validation
pnpm --filter @browserbasehq/stagehand run build:esmpnpm --filter @browserbasehq/stagehand run test:core -- packages/core/dist/esm/tests/unit/llm-provider.test.js packages/core/dist/esm/tests/unit/api-variables-schema.test.js packages/core/dist/esm/tests/unit/public-api/llm-and-agents.test.jspnpm --filter @browserbasehq/stagehand-server-v3 run gen:openapipnpm --filter @browserbasehq/stagehand-server-v3 run build:esm-testspnpm --filter @browserbasehq/stagehand-server-v3 run test:server -- packages/server-v3/dist/tests/unit/requestModelConfig.test.jspnpm --filter @browserbasehq/stagehand run typecheckpnpm --filter @browserbasehq/stagehand-server-v3 run typecheckSummary by cubic
Adds Azure OpenAI Microsoft Entra ID bearer-token auth to Stagehand. Implements STG-2090 and updates types, schemas, and OpenAPI to support the new
azureprovider.New Features
provider: "azure"withauth: { type: "azureEntraId", token }andproviderOptions.azure(resourceName, baseURL, apiVersion, useDeploymentBasedUrls, headers).@ai-sdk/azuretokenProvider; Azure runs without experimental mode and never sends an API key when provider auth is set.apiKey/auth) across client and server.withModelApiKeyFallback, and reject configs that mixapiKeywith Entra auth.AgentType: "azure"); regenerate OpenAPI with Azure schemas and normalize the generator output to preserve Azure union branches.Dependencies
@ai-sdk/azureto^2.0.109.Written for commit 19e7a24. Summary will update on new commits.