Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: browserbase/stagehand
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @browserbasehq/stagehand@3.7.3
Choose a base ref
...
head repository: browserbase/stagehand
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: stagehand-server-v3/v3.7.7
Choose a head ref
  • 7 commits
  • 264 files changed
  • 5 contributors

Commits on Oct 13, 2026

  1. fix(v3): set additionalProperties false on nullable act action schema (…

    …#3150)
    
    ## Why
    
    `act` fails on OpenAI models routed through the AI SDK client (for
    example `openai/gpt-4.1-nano`) with:
    
    ```
    Invalid schema for response_format 'response': In context=('properties', 'action', 'anyOf', '0'),
    'additionalProperties' is required to be supplied and to be false.
    ```
    
    `AISdkClient` sends OpenAI requests with `strictJsonSchema: true`, and
    OpenAI strict mode requires `additionalProperties: false` on every
    object. `generateObject` converts the Zod schema with the AI SDK's own
    converter, which leaves that field off the object inside the nullable
    `action`'s `anyOf`. The direct provider clients use `toJsonSchema` and
    already emit it.
    
    This is what fails `server/v3/integration/v3/act` and
    `server/v3/integration/v3/agentExecute` (the variables tests return an
    empty field because the agent's `act` tool call 400s). See #3114.
    
    ## What changed
    
    - Mark the action object with `.meta({ additionalProperties: false })`
    when running on Zod 4. `zod` is a peer dependency (`^3.25 || ^4`) and
    Zod 3 has no `.meta()`; its converter already emits the field, so the
    call is skipped there. This changes only the generated JSON schema.
    Parsing still strips unknown keys, so clients that validate locally
    (Google, AI SDK providers without strict mode, custom clients) keep
    accepting responses with extra fields. `.strict()` was considered and
    rejected because it would make those responses fail validation.
    - Unit tests check both converters, that parsing still strips unknown
    keys, and that `act()` builds its schema under a Zod 3 peer.
    
    ## Test plan
    
    - [x] New `act-response-schema` unit tests pass; the AI SDK converter
    test fails without the fix.
    - [x] `act-response-schema-zod3` (mocks `zod` with `zod/v3`) passes;
    without the guard it fails with `actionSchema.meta is not a function`.
    - [x] `inference-temperature` unit tests pass.
    - [x] Live `generateObject` call with `@ai-sdk/openai` `gpt-4.1-nano`
    and `strictJsonSchema: true`: without the fix it returns the 400 above;
    with the fix it returns a valid action.
    - [x] ESLint and Prettier clean.
    
    <!-- This is an auto-generated description by cubic. -->
    ---
    ## Summary by cubic
    Fixes `act` calls failing on OpenAI models routed through the AI SDK
    client. OpenAI strict mode requires `additionalProperties: false` on
    every object, and the AI SDK schema converter omitted it inside the
    nullable `action`'s `anyOf`, producing an `invalid_json_schema` 400.
    
    - Sets `additionalProperties: false` via `.meta()` so only the generated
    JSON schema changes; parsing still strips unknown keys, so clients that
    validate locally keep accepting responses with extra fields.
    - Calls `.meta()` only under Zod 4 since `zod` is a peer dependency
    (^3.25 || ^4) and its Zod 3 import lacks the method; the Zod 3 converter
    already emits the field.
    - Adds unit tests for the AI SDK and `toJsonSchema` converters,
    including the Zod 3 path.
    
    <sup>Written for commit 8c3658a.
    Summary will update on new commits.</sup>
    
    <a
    href="https://cubic.dev/pr/browserbase/stagehand/pull/3150?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="View guided diff"
    src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
    <a
    href="https://www.cubic.dev/action/auto-fix/pr/browserbase/stagehand/3150?returnTo=https%3A%2F%2Fgithub.com%2Fbrowserbase%2Fstagehand%2Fpull%2F3150&source=description"
    target="_blank" rel="noopener noreferrer"
    data-no-image-dialog="true"><picture><source
    media="(prefers-color-scheme: dark)"
    srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
    media="(prefers-color-scheme: light)"
    srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
    alt="Turn on auto-fix"
    src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
    
    <!-- End of auto-generated description by cubic. -->
    miguelg719 authored Oct 13, 2026
    Configuration menu
    Copy the full SHA
    69c2440 View commit details
    Browse the repository at this point in the history

Commits on Oct 14, 2026

  1. fix(v3): honor CAPTCHA awareness options for local attachments (#3114)

    ## Summary
    
    - Honor `browserbaseSessionCreateParams.browserSettings.solveCaptchas`
    and `waitForCaptchaSolves` for local attachments. An explicit `false`
    for either option disables awareness; absent options retain
    Browserbase-on/local-off defaults.
    - Resolve awareness from constructor options so it is available before
    CDP initialization, then forward it through the SDK session-start
    request and standalone v3 server.
    - Reuse the existing waiting, solved-notice, and computer-use
    widget-avoidance behavior without changing CDP routing, session
    ownership, or shutdown behavior. No subclass or customer-specific flag.
    - Update option/schema documentation, add a patch changeset, and cover
    the option matrix and SDK bootstrap forwarding.
    
    ## Validation
    
    - 68 focused compiled tests passed across eight suites: CAPTCHA options,
    agent CAPTCHA hooks, solver timing, Browserbase accessors, API default
    model config, API serialization, optional model API keys, and agent
    prompt variables.
    - ESM and CommonJS builds passed.
    - Package and standalone v3 server typechecks passed.
    - Targeted ESLint, Prettier, and diff whitespace checks passed.
    - No live hosted CAPTCHA session was tested.
    
    ---
    ## Summary by cubic
    Fixes CAPTCHA awareness for local attachments in Stagehand v3 so agents
    no longer interfere with Browserbase solves or stop at already-solved
    widgets.
    
    Previously the `waitForCaptchaSolves` and
    `browserSettings.solveCaptchas` options only took effect when `env:
    "BROWSERBASE"`, since awareness was gated on the environment. Now
    `isCaptchaAutoSolveEnabled` resolves from constructor options before CDP
    initialization, with `waitForCaptchaSolves ?? solveCaptchas ?? env ===
    "BROWSERBASE"` as the default and `solveCaptchas: false` always
    disabling awareness. The resolved value is forwarded through the SDK
    session-start request and the standalone v3 server.
    
    - Reuses existing waiting, solved-notice, and widget-avoidance behavior;
    CDP routing, session ownership, and shutdown are unchanged.
    - Adds a patch changeset, updates option/schema documentation, and
    covers the option matrix plus API forwarding in tests.
    - Targeting v3 only; the Browserbase API dependency update and package
    publication remain required for the hosted fix.
    
    **Rollout**
    - Publish the package, update the API's Orca dependency, and deploy the
    API forwarding change.
    - This does not add a CAPTCHA solver for ordinary local attachments;
    solve events emitted before listeners attach remain unhandled.
    
    <sup>Written for commit 90d5767.
    Summary will update on new commits.</sup>
    
    <a
    href="https://cubic.dev/pr/browserbase/stagehand/pull/3114?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. -->
    miguelg719 authored Oct 14, 2026
    Configuration menu
    Copy the full SHA
    f6b3d85 View commit details
    Browse the repository at this point in the history
  2. fix(v3): avoid forced done tool use for newer Claude models (#3132)

    ## Summary
    
    The v3 DOM/hybrid agent's final `done` request can fail when Claude
    Sonnet 5.5, Opus 5.5, or Fable 5.1 rejects forced tool use. Use
    automatic tool choice for these models, preserving the existing Fable 5
    behavior and conservative incomplete result for plain-text replies.
    
    - Cover all four models with bare and `anthropic/`-prefixed IDs,
    tool-call responses, and text responses.
    - Include a patch changeset for `@browserbasehq/stagehand`.
    - Merge current `v3` (`f6b3d851d`) into the PR branch.
    
    ## Validation
    
    - ESM build, core TypeScript check, ESLint for changed TypeScript files,
    and test formatting passed.
    - 36 tests passed across agent done-tool choice, Anthropic options, and
    the v3 act response-schema regression suites.
    - Fresh CI on `fd298e269`: 242 checks passed, 8 skipped, none failed or
    pending. Both previously failing server `act` and `agentExecute` checks
    pass.
    
    ## Scope
    
    This fixes the final `done` request in the v3 DOM/hybrid agent path.
    Live model behavior and a full browser run with prior thinking blocks
    were not revalidated in this review. CUA support remains separate.
    
    ---------
    
    Co-authored-by: miguel <miguelg71921@gmail.com>
    shubh24 and miguelg719 authored Oct 14, 2026
    Configuration menu
    Copy the full SHA
    09063f6 View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2026

  1. Fix(v3): use XPath as fallback when the page has a shadow root (#3287)

    # why
    
    When the page has a shadow root, the resolver walks the tree with its
    own composed and shadow-hop traversal, and that walk reads
    `element.children`. However, some component libraries override
    `children` on a host element, leading to the walk stopping at the host
    and finding 0 matches.
    
    XPath is able to find the element in these cases since it sees the
    actual DOM, so including XPath as a fallback option solves this issue.
    
    # what changed
    
    - `resolveXPathAtIndex` and `countXPathMatches` updates: if composed and
    shadow-hop traversal both find 0 matches, use native XPath. The fallback
    is used only when there are no matches at all, not when the index is out
    of range. Native XPath cannot cross a shadow boundary, so it cannot
    change results for shadow DOM paths that already resolve.
    - Added an integration test in `locator-count.spec.ts`. The page has a
    shadow root and a host that overrides `children`, and
    `locator(xpath).count()` must return 1.
    
    # test plan
    
    - `pnpm --filter @browserbasehq/stagehand test:core` to run the new
    integration test
    
    <!-- This is an auto-generated description by cubic. -->
    ---
    ## Summary by cubic
    Fixes XPath resolution so locators still find light DOM elements when a
    page has a shadow root and a host element overrides its `children`
    property.
    
    Because the composed and shadow-hop traversal reads `element.children`,
    component libraries that override that property could cause locators to
    find 0 matches. When both traversals return no matches, the resolver now
    falls back to native XPath, which ignores the override. The fallback
    only fires when there are no matches at all, so it doesn't affect shadow
    DOM paths that already resolve.
    
    <sup>Written for commit ef28c59.
    Summary will update on new commits.</sup>
    
    <a
    href="https://cubic.dev/pr/browserbase/stagehand/pull/3287?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="View guided diff"
    src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
    <a
    href="https://www.cubic.dev/action/auto-fix/pr/browserbase/stagehand/3287?returnTo=https%3A%2F%2Fgithub.com%2Fbrowserbase%2Fstagehand%2Fpull%2F3287&source=description"
    target="_blank" rel="noopener noreferrer"
    data-no-image-dialog="true"><picture><source
    media="(prefers-color-scheme: dark)"
    srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
    media="(prefers-color-scheme: light)"
    srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
    alt="Turn on auto-fix"
    src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
    
    <!-- End of auto-generated description by cubic. -->
    akeimach authored Oct 21, 2026
    Configuration menu
    Copy the full SHA
    27ee07c View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2026

  1. [v3]: rm browse (#3306)

    # why
    - the source does not live on this branch anymore
    
    <!-- This is an auto-generated description by cubic. -->
    ---
    ## Summary by cubic
    Removes the `browse` CLI package and all references to it across the
    repo, since its source no longer lives on the `v3` branch.
    
    - Deletes `packages/cli`, including commands, docs, guides, skills,
    media, and the Dockerfile.
    - Removes the CLI release workflow, CI path filtering for
    `packages/cli`, the root `test:cli` script, and the changeset ignore
    entry.
    
    <sup>Written for commit f8a641a.
    Summary will update on new commits.</sup>
    
    <a
    href="https://cubic.dev/pr/browserbase/stagehand/pull/3306?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="View guided diff"
    src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
    <a
    href="https://www.cubic.dev/action/auto-fix/pr/browserbase/stagehand/3306?returnTo=https%3A%2F%2Fgithub.com%2Fbrowserbase%2Fstagehand%2Fpull%2F3306&source=description"
    target="_blank" rel="noopener noreferrer"
    data-no-image-dialog="true"><picture><source
    media="(prefers-color-scheme: dark)"
    srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
    media="(prefers-color-scheme: light)"
    srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
    alt="Turn on auto-fix"
    src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
    
    <!-- End of auto-generated description by cubic. -->
    seanmcguire12 authored Oct 23, 2026
    Configuration menu
    Copy the full SHA
    2a0793b View commit details
    Browse the repository at this point in the history
  2. [v3]: pin patched node version in ci (#3307)

    # why
    
    # what changed
    
    # test plan
    
    
    <!-- This is an auto-generated description by cubic. -->
    ---
    ## Summary by cubic
    Pins all CI workflows to Node.js `24.22.1` instead of the floating
    `20.x` version so jobs run on a known patched release.
    
    - Updates the setup-node action default and every workflow that overrode
    `node-version`.
    - Removes the obsolete npm compatibility comment in `release.yml` since
    the release job now runs on Node 24.
    
    <sup>Written for commit 1f58095.
    Summary will update on new commits.</sup>
    
    <a
    href="https://cubic.dev/pr/browserbase/stagehand/pull/3307?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="View guided diff"
    src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
    <a
    href="https://www.cubic.dev/action/auto-fix/pr/browserbase/stagehand/3307?returnTo=https%3A%2F%2Fgithub.com%2Fbrowserbase%2Fstagehand%2Fpull%2F3307&source=description"
    target="_blank" rel="noopener noreferrer"
    data-no-image-dialog="true"><picture><source
    media="(prefers-color-scheme: dark)"
    srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
    media="(prefers-color-scheme: light)"
    srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
    alt="Turn on auto-fix"
    src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
    
    <!-- End of auto-generated description by cubic. -->
    seanmcguire12 authored Oct 23, 2026
    Configuration menu
    Copy the full SHA
    4c9f4da View commit details
    Browse the repository at this point in the history
  3. [chore]: bump node version in SEA binary (#3312)

    # why
    - we need to bump the version of node in the sea binary per the [oct
    2026 security
    fixes](https://nodejs.org/en/blog/vulnerability/october-2026-security-releases)
    
    <!-- This is an auto-generated description by cubic. -->
    ---
    ## Summary by cubic
    Rebuilds the standalone server binaries with Node.js 24.22.1 and Undici
    7.30.1 so they include the October 2026 security fixes, and documents
    the required Node versions for users running from source.
    
    - The SEA binary build now verifies the active Node runtime and refuses
    to run on unpatched versions like 22.23.3 or 24.22.0.
    - Turbo caching is disabled for the SEA binary build so stale
    executables are not reused after a runtime upgrade.
    - Users running the SDK in their own Node installation must upgrade Node
    separately; the SDK does not update Node for them.
    - Bumps `undici` to `^7.30.1` via the root `package.json` override and
    updates the lockfile.
    - Developers building from source should clone with `--branch v3` as
    reflected in the README updates.
    - Updates the v3 integration tests to use `gpt-4.1-mini` instead of the
    retired `gpt-4.1-nano`.
    
    <sup>Written for commit a492937.
    Summary will update on new commits.</sup>
    
    <a
    href="https://cubic.dev/pr/browserbase/stagehand/pull/3312?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="View guided diff"
    src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
    <a
    href="https://www.cubic.dev/action/auto-fix/pr/browserbase/stagehand/3312?returnTo=https%3A%2F%2Fgithub.com%2Fbrowserbase%2Fstagehand%2Fpull%2F3312&source=description"
    target="_blank" rel="noopener noreferrer"
    data-no-image-dialog="true"><picture><source
    media="(prefers-color-scheme: dark)"
    srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
    media="(prefers-color-scheme: light)"
    srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
    alt="Turn on auto-fix"
    src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
    
    <!-- End of auto-generated description by cubic. -->
    seanmcguire12 authored Oct 23, 2026
    Configuration menu
    Copy the full SHA
    e11bbe5 View commit details
    Browse the repository at this point in the history
Loading