docs: simplify model config in basics snippets to use string format#4
Open
chromiebot wants to merge 25 commits into
Open
docs: simplify model config in basics snippets to use string format#4chromiebot wants to merge 25 commits into
chromiebot wants to merge 25 commits into
Conversation
## Why The original server-v4 stacked PRs merged into each other after `STG-1614` had already merged into `main`, so the env/test-harness work, Drizzle foundation, and Drizzle schema/controller flow never actually reached `main`. This PR recovers that full stack onto current `main` in one branch. ## What Changed - cherry-picked the three stacked squash-merge commits from `browserbase#1896`, `browserbase#1897`, and `browserbase#1898` onto fresh `main` - preserved the full `server-v4` env/test harness cleanup, Drizzle foundation, DB smoke tests, schema/migration work, and `/v4/llms` controller/service/repo flow - added one small follow-up commit to normalize `pnpm-lock.yaml` against current `main` after applying the recovered stack ## Test Plan - `pnpm install` - `pnpm --filter @browserbasehq/stagehand-server-v4 run lint` - `pnpm --filter @browserbasehq/stagehand-server-v4 run test:unit` - `pnpm --filter @browserbasehq/stagehand-server-v4 run build` - `pnpm --filter @browserbasehq/stagehand-server-v4 run gen:openapi` <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Recovers the server‑v4 Drizzle stack onto `main`, restoring DB‑backed `/v4/llms` and switching the public `LLMId` to UUID. Adds a typed env, clean app bootstrap, and a local `pglite`/Postgres runtime with migrations, tests, and a simpler source‑based test harness. - **New Features** - Drizzle foundation with `pglite` default and Postgres option; new `db:*` scripts via `drizzle-kit`. - Fastify `databasePlugin` and unified DB client; `app.ts` bootstrap with health/readiness and Swagger/OpenAPI; env via `@t3-oss/env-core`. - Tables/relations for LLMs and Stagehand; DB‑derived Zod schemas; first migration; OpenAPI updated for UUID `LLMId` with strict format and pattern. - LLM module (repo/service/controller) backing `/v4/llms`; routes now delegate to the controller; browser session create uses the service and auto‑creates a system default LLM when `llmId` is missing. - Tests run from source via `tsx`; test server script simplified; `turbo` tasks cleaned up; schema cleanup (`z.url()`). - **Migration** - Run: `pnpm --filter @browserbasehq/stagehand-server-v4 db:migrate`. - Local dev uses `pglite` at `~/.stagehand/db/stagehand-v4`. For Postgres set `STAGEHAND_DB_MODE=postgres` and `DATABASE_URL`. - Update clients to treat `LLMId` as a UUID and regenerate from `openapi.v4.yaml` if needed. <sup>Written for commit 1fb861e. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/1917">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. --> --------- Co-authored-by: Nick Sweeting <github@sweeting.me> Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
## Summary Move browse-cli to a merge-first release flow so `main` becomes the source of truth before npm is mutated. ## New release flow 1. Merge normal feature PRs into `main`, with browse-cli changesets as usual. 2. Trigger `Prepare CLI Release` when browse-cli is ready to ship. 3. That workflow versions only `@browserbasehq/browse-cli` and opens or updates a release PR. 4. Merge the release PR. 5. The existing `Release` workflow on `main` detects the browse-cli version bump, publishes a packed tarball to npm with provenance, and tags the merge commit. ## What changed - rewired `release-cli.yml` into a prepare-only workflow that creates or updates a release PR instead of publishing directly - moved browse-cli publishing into `release.yml`, gated on an actual version bump landing on `main` - kept the `pnpm pack` -> `npm publish --provenance` path so workspace dependencies are resolved in the published tarball - made the main-branch publish path idempotent when that browse-cli version is already on npm - kept browse-cli tagging on the merge commit instead of trying to tag from the manual workflow - synced `packages/cli/package.json` to `0.3.0` and documented npm `0.3.0` as a broken publish in the CLI changelog ## Why this is better The previous standalone release design could succeed at publishing to npm and then fail while trying to sync `main`, which left npm ahead of git. That is the hard failure mode because npm versions are immutable. This PR flips the order: - git changes land first through a normal PR - npm publish happens afterward from the exact merged commit That removes the whole class of "published version is not reflected on `main`" failures and makes reruns much safer. ## Validation - `pnpm exec prettier --check .github/workflows/release.yml .github/workflows/release-cli.yml packages/cli/package.json packages/cli/CHANGELOG.md` - packed `packages/cli` locally and verified the tarball manifest resolves `@browserbasehq/stagehand` to `3.2.0` - confirmed the currently published npm `0.3.0` manifest still contains the broken `workspace:*` dependency - simulated the prepare flow in a throwaway worktree and confirmed it would cut `0.4.0` from the current 2 minor + 2 patch browse-cli changesets
Prepare the next browse-cli release by versioning the package on `main`. What this PR does: - bumps `packages/cli/package.json` to `0.4.0` - updates the browse-cli changelog - consumes the pending browse-cli changesets After this PR merges, the `Release` workflow on `main` will publish `@browserbasehq/browse-cli@0.4.0` from that exact commit using `pnpm pack` + `npm publish --provenance`. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Release `@browserbasehq/browse-cli` 0.4.0 with new session attach and smarter local Chrome discovery, plus stability fixes. Bumps the package version and updates the changelog; the Release workflow will publish from this commit. - **New Features** - Add `--connect` to attach to an existing Browserbase session by ID. - `browse env local` auto-discovers debuggable Chrome and attaches when found (falls back to isolated). Adds `--isolated`, positional CDP target, and `--ws` accepts bare port numbers. - **Bug Fixes** - Add CLI metadata to Browserbase sessions created via the CLI. - Clear cached browser state when CDP connection drops to prevent “awaitActivePage: no page available” errors. <sup>Written for commit d744934. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/1925">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# why - models would sometimes respond with the variable name without wrapping it in percentage signs. - when this happens, the regex would fail to replace the variable name with the actual variable value # what changed - adjusted the prompting for the condition when `variables` are provided by the user - the updated prompting is more specific around what the variables are used for, and the required return shape. # test plan - existing act evals <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Hardened the act variables prompt so models always return argument placeholders as %variableName%, preventing failed variable substitution. Also clarified the element ID format with concrete examples. - **Bug Fixes** - Added explicit, repeated guidance to use %variableName% in the `arguments` array when variables are provided. - Improved element ID schema description with examples like '0-76' and '16-21'. - **Refactors** - Introduced `buildActVariablesPrompt()` and reused it in both act and step-two prompts to keep messaging consistent and avoid duplication. <sup>Written for commit 8b592f2. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/1922">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. -->
# why - when a user created a new tab by clicking the "+" icon in a headful chromium browser, stagehand would not attach to it, because it filtered out the `"chrome://newtab"` url pattern # what changed - extended the conditional in `isNonWebTarget()` to allow for `"chrome://newtab"` URLs to pass through, so that stagehand can attach to them <img width="491" height="95" alt="Screenshot 2026-03-30 at 4 00 48 PM" src="https://github.com/user-attachments/assets/64638fc4-7334-4438-8df5-5a91344b6afb" /> # test plan - added a test which creates a newtab target, & confirms that a new page object gets created <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes `@browserbasehq/stagehand` not attaching to tabs opened via the "+" button in Chromium by tracking `chrome://newtab/` page targets so a page is created and becomes usable after navigation. - **Bug Fixes** - Updated `isNonWebTarget()` to always track top-level `page` targets, even with non-web schemes like `chrome://newtab/`. - Added Playwright tests to verify `chrome://newtab/` tabs appear in `pages()` and work after navigating to a web URL. <sup>Written for commit 9791271. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/1924">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. -->
…erbase#1911) ## Summary - The `browse-cli` metadata key (with hyphen) is rejected by the Browserbase API as an invalid metadata key, causing `env remote` to fail with a `400 Key is not a valid metadata key: browse-cli` error. - Changed the key to `browse_cli` (underscore) which is a valid metadata key format. Linear: https://linear.app/browserbase/issue/STG-1733/fix-use-valid-metadata-key-for-browse-cli-sessions ## Test plan - [x] Verified old key (`browse-cli`) returns 400 from Browserbase API - [x] Verified new key (`browse_cli`) returns 201 and session creates successfully 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Shrey Pandya <shrey@browserbase.com>
Prepare the next browse-cli release by versioning the package on `main`. What this PR does: - bumps `packages/cli/package.json` to `0.4.1` - updates the browse-cli changelog - consumes the pending browse-cli changesets After this PR merges, the `Release` workflow on `main` will publish `@browserbasehq/browse-cli@0.4.1` from that exact commit using `pnpm pack` + `npm publish --provenance`. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Release `@browserbasehq/browse-cli@0.4.1`, a patch that fixes an invalid session metadata key. This bumps the package version and updates the changelog for publishing from `main`. - **Bug Fixes** - Use underscore in `browse_cli` session metadata keys instead of a hyphen. <sup>Written for commit 022c400. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/1932">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…test (browserbase#1934) ## Summary - **Root cause:** The `changesets/action` step corrupts git state by checking out `changeset-release/main` and creating a new commit. After it returns, `HEAD` points to the wrong branch/commit. The browse-cli check step uses `HEAD`/`HEAD^` which are now wrong, so it always says "browse-cli version did not change" and skips the publish. Then the stagehand canary step (`changeset publish --tag alpha`) finds the unpublished version and publishes it under `alpha` instead of `latest`. - **Fix:** Replace all `HEAD`/`HEAD^` references with `${{ github.sha }}`/`${{ github.sha }}^` (the actual merge commit SHA, immune to branch switches). Add `git checkout ${{ github.sha }}` to restore the working tree. Add explicit `--tag latest` to the publish command. - **New:** Add a browse-cli canary step that publishes `X.Y.Z-alpha-{sha}` versions under the `alpha` tag on feature branch merges (matching stagehand's existing canary pattern). ## What was happening 1. PR merged to main with browse-cli version bump (e.g. 0.3.0 -> 0.4.0) 2. `changesets/action` runs, switches to `changeset-release/main`, creates commit 3. `HEAD` now points to the changeset PR commit, not the merge commit 4. browse-cli check compares wrong commits, finds no version change, sets `should_publish=false` 5. Stagehand canary step runs `changeset publish --tag alpha`, which picks up the unpublished browse-cli and publishes it under `alpha` 6. Result: `npm info @browserbasehq/browse-cli` shows `latest: 0.3.0`, `alpha: 0.4.0` ## What this PR does 1. Uses `${{ github.sha }}` (the actual merge commit) instead of `HEAD` for all git comparisons 2. Adds `git checkout ${{ github.sha }}` to restore the working tree after changesets/action 3. Adds `--tag latest` to the `npm publish` command for clean releases 4. Adds a new "Publish browse-cli canary" step for feature branch merges (publishes `X.Y.Z-alpha-{sha}` under `alpha` tag) ## Validation - Traced CI logs from recent releases to confirm `HEAD` was pointing to `changeset-release/main` after the changesets step - Confirmed `npm view @browserbasehq/browse-cli` shows `latest: 0.3.0` while `alpha: 0.4.1` (the bug in action) - `${{ github.sha }}` is set by GitHub Actions to the merge commit SHA and is immutable throughout the run ## Linear https://linear.app/browserbase/issue/STG-1739/fix-browse-cli-release-publishes-under-alpha-instead-of-latest 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes the release workflow so `@browserbasehq/browse-cli` clean releases publish to `latest`, and canaries publish to `alpha`. Addresses Linear STG-1739 by using the immutable merge SHA to avoid `changesets/action` HEAD switches. - **Bug Fixes** - Use `${{ github.sha }}`/`${{ github.sha }}^` for diffs and version reads to avoid wrong `HEAD`. - Restore the working tree before checks/publish and reset `packages/cli/package.json` after canary publish. - Publish clean releases with `npm publish ... --tag latest`. - **New Features** - Add canary step that publishes `X.Y.Z-alpha-{shortSha}` to `alpha` when CLI files changed but no clean release occurred. - Skip canary if the version already exists or no CLI changes are detected. <sup>Written for commit c075ece. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/1934">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. --> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
# why
- In some scenarios, users need more granular control / access to the
LLM at the provider leve
# what changed
- Added support for passing custom "middleware" in the model options
# test plan
- wrote tests
- tested locally with own middleware
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds first-class LLM middleware to intercept and wrap model calls for
logging, usage tracking, or request transforms without changing call
sites. Per-call middleware is used only for that call and is not cached.
- **New Features**
- Accepts `middleware: LanguageModelV2Middleware` in `V3` model config;
`LLMProvider` and `getAISDKLanguageModel` wrap models via
`wrapLanguageModel` from `ai`.
- Supports per-call overrides via `model` options; override middleware
is passed through `LLMProvider.getClient`, applies only to that call,
and is never cached.
- Works across providers and preserves `modelId`, `doGenerate`, and
`doStream`. Tests cover usage capture, streaming, errors, chaining, and
edge cases.
- **Migration**
- To use: pass `middleware` in `model` config or a per-call override,
e.g. `{ modelName: 'openai/gpt-4o', apiKey: '...', middleware }`.
- Middleware is only applied in direct/local execution and is not
serialized over HTTP.
<sup>Written for commit b09e42c.
Summary will update on new commits. <a
href="https://cubic.dev/pr/browserbase/stagehand/pull/1872">Review in
cubic</a></sup>
<!-- End of auto-generated description by cubic. -->
… family (browserbase#1852) Mirrored from external contributor PR browserbase#1844 after approval by @miguelg719. Original author: @praveentcom Original PR: browserbase#1844 Approved source head SHA: `a637dc329bfc5426bb71c8551c812191ed631527` @praveentcom, please continue any follow-up discussion on this mirrored PR. When the external PR gets new commits, this same internal PR will be marked stale until the latest external commit is approved and refreshed here. ## Original description All GPT-5.x series models don't support `minimal` as the `reasoningEffort`. Currently, it is enabled only for GPT-5.1 and GPT-5.2 models to set the reasoningEffort as `low`. This would start throwing errors like these. `Unsupported value: 'minimal' is not supported with the 'gpt-5.4' model. Supported values are: 'none', 'low', 'medium', 'high', and 'xhigh'.` This PR fixes the behavior to set the reasoning effort as low for all GPT-5.x series models so that we don't need to manually patch it every time when a new SOTA model is released. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Default `reasoningEffort` to "none" for all `gpt-5.*` models (excluding `codex`) to avoid unsupported "minimal" errors, with an override via `ClientOptions.reasoningEffort`, and default GPT-5 `textVerbosity` set to "low". Also plumbs `clientOptions` into both `AISdkClient` and `AISdkClientWrapped` and applies the same reasoning/text-verbosity behavior (`codex` stays "medium"). <sup>Written for commit a9797cc. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/1852">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. --> <!-- external-contributor-pr:owned source-pr=1844 source-sha=a637dc329bfc5426bb71c8551c812191ed631527 claimer=miguelg719 --> --------- Co-authored-by: Praveen Thirumurugan <mail@praveent.com> Co-authored-by: miguel <miguelg71921@gmail.com>
## Summary - Adds `browse get markdown [selector]` to convert page HTML to clean markdown - Defaults to body content when no selector given, accepts optional CSS/XPath/ref selector - Uses `node-html-markdown` for quality conversion (links, tables, code blocks preserved) - Useful for agents that need readable page content without HTML noise ## Usage ```bash browse get markdown # full page body as markdown browse get markdown .article # specific element browse get markdown @0-5 # ref from snapshot ``` ## Test results | Test | Local | Remote (Browserbase) | |------|-------|---------------------| | `get markdown` (body default) | HN full page markdown | HN full page markdown | | `get markdown .titleline` (selector) | Clean link with title | Clean link with title | ## Test plan - [x] Test locally with no selector (full body) - [x] Test locally with CSS selector - [x] Test on remote Browserbase session (no selector) - [x] Test on remote Browserbase session (with selector) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
## Summary - return underlying operation error messages from server-v3 streaming handlers - return underlying non-AppError messages from the top-level server-v3 error wrapper - preserve existing status code behavior while making local act/extract/observe 500s diagnosable ## Testing - pnpm --filter @browserbasehq/stagehand-server-v3 typecheck <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Pass through underlying operation errors in `@browserbasehq/stagehand-server-v3` so clients see real failure messages during streaming and top-level responses, and force flow logs on for easier debugging. Status codes stay the same, making local act/extract/observe 500s diagnosable. - **Bug Fixes** - Streaming + error wrapper: return the thrown error’s message for non-`AppError` cases; fall back to a default when not an `Error`, preserving status codes. - Observe route: remove unused `Variables` import/cast to satisfy lint; no behavior change. <sup>Written for commit ba08fd0. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/1937">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. -->
Compute server-v3 and server-v4 release versions from the latest server tag plus changeset bumps, instead of recomputing from package.json. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Compute next server release versions for v3 and v4 from the latest git tag plus changeset bumps, instead of package.json. This keeps release tags consistent and avoids version drift. - **Bug Fixes** - Parse changed `.changeset/*.md` since the last `stagehand-server-v3/v*` or `stagehand-server-v4/v*` tag to find the highest bump for `@browserbasehq/stagehand-server-v3` and `@browserbasehq/stagehand-server-v4`. - Increment the tagged version (major/minor/patch), default to `0.0.0` if no tag, remove `changeset status`/`changeset-status.json`, and output `release`, `version`, and tag. <sup>Written for commit aebfc6c. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/1938">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. -->
…e#1939) Trigger the server-v3 and server-v4 release workflows when their workflow files change, and ignore deleted changeset files during release detection. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Make server-v3 and server-v4 release workflows run when their own workflow files change, and prevent false releases by ignoring deleted changeset files. - **Bug Fixes** - Trigger on changes to `.github/workflows/stagehand-server-v3-release.yml` and `.github/workflows/stagehand-server-v4-release.yml` on pushes to `main`. - Use `git diff --diff-filter=d` so removed `.changeset/*.md` files don’t count as changes. <sup>Written for commit 3f5911a. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/1939">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. -->
Resolve server-v3 and server-v4 release versions from remote tags, fail instead of bootstrapping from 0.0.0, and refuse to publish any version that does not advance the highest existing remote tag. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Resolve release versions for `@browserbasehq/stagehand-server-v3` and `@browserbasehq/stagehand-server-v4` from remote Git tags and add guardrails to stop non-advancing or bootstrapped releases. Workflows fail if no remote release tag exists. - **Bug Fixes** - Determine latest remote tag with `git ls-remote --tags` (no local tag reliance). - Fetch the resolved tag before diffing and ignore deleted changeset files. - Require the computed version to advance the highest remote version; otherwise fail. - Fail when no remote tag is found (no `0.0.0` bootstrap). <sup>Written for commit 77c176c. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/1940">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. -->
Fix the server-v3/v4 release workflows to resolve remote tags without the broken nested heredoc shell pattern, while keeping the no-fallback release guards. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes the server v3/v4 release workflows by avoiding fragile shell parsing with a Node tag resolver that writes to a temp file. Keeps no-fallback guards and ensures versions advance from the latest remote tag. - **Bug Fixes** - Resolve latest remote tag with git ls-remote in Node (no local tag reliance). - Write resolver output to a temp file instead of stdout to avoid shell parsing bugs. - Block release if no remote tag exists and enforce version > highest remote. - Applies to `@browserbasehq/stagehand-server-v3` and `@browserbasehq/stagehand-server-v4`. <sup>Written for commit 2c3a827. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/1941">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. -->
Prepare the next browse-cli release by versioning the package on `main`. What this PR does: - bumps `packages/cli/package.json` to `0.4.2` - updates the browse-cli changelog - consumes the pending browse-cli changesets After this PR merges, the `Release` workflow on `main` will publish `@browserbasehq/browse-cli@0.4.2` from that exact commit using `pnpm pack` + `npm publish --provenance`. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Publish `@browserbasehq/browse-cli` 0.4.2 by bumping the version and updating the changelog. This release adds a command to convert page HTML to Markdown. - **New Features** - Add `browse get markdown [selector]` to convert page HTML to Markdown. Defaults to body; supports an optional selector; preserves links, tables, and code blocks via `node-html-markdown`. <sup>Written for commit eb2b85f. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/1942">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…e#1945) ## Summary - make `browse env local` default back to an isolated local browser - add `browse env local --auto-connect` as the explicit opt-in path for auto-discovering a debuggable local Chrome - keep explicit CDP attach via `browse env local <port|url>` and add tests to lock in the strategy behavior ## Why `browse env local` was auto-attaching to an existing local Chrome by default. That can trigger Chrome's remote debugging approval dialog unexpectedly and makes isolated local usage less predictable. ## Impact Users now get a clean local browser by default, while still having two explicit ways to reuse an existing browser when they want to: - `browse env local --auto-connect` - `browse env local <port|url>` ## Test Plan - `pnpm --filter @browserbasehq/browse-cli build` - `pnpm --filter @browserbasehq/browse-cli test` - `pnpm exec prettier --check packages/cli && cd packages/cli && pnpm run eslint && pnpm run typecheck` - e2e smoke test against a disposable Chrome CDP endpoint on `127.0.0.1:9229` using a temporary `HOME` / user-data-dir so the checks do not touch a real browsing profile - verified `browse env local` returns `localStrategy: "isolated"` - verified `browse status` in isolated mode reports `localSource: "isolated"` - verified `browse env local` and `browse status` both print the hint to use `browse env local --auto-connect` to reuse local credentials/cookies - verified `browse env local --auto-connect` returns `localStrategy: "auto"` - verified `browse env local --auto-connect` prints the hint that plain `browse env local` switches back to an isolated Chromium browser - verified `open https://example.com` succeeds after `--auto-connect` - verified `browse status` after `--auto-connect` reports `localSource: "attached-existing"` with the resolved CDP URL and the isolated-browser hint - verified `browse env local 9229` returns `localStrategy: "cdp"` - verified `browse status` after `browse env local 9229` reports `localSource: "attached-explicit"` Linear: STG-1752 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Defaulted `browse env local` to a clean, isolated browser. Added `--auto-connect` to opt into reusing a debuggable Chrome, kept explicit CDP attach via `browse env local <port|url>`, and added mode hints to guide users. Addresses Linear STG-1752 to make local usage predictable and avoid surprise debugging prompts. - **New Features** - Isolated local browser is now the default; auto-discovery only with `--auto-connect`. - Mode hints in `browse env`/`browse status` suggest when to use `--auto-connect` or switch back to isolated. - `browse env local <port|url>` remains for explicit CDP targets. - Centralized strategy resolution in `src/local-strategy.ts` with unit tests. - Clearer `browse env` usage and validation; rejects mixing `--auto-connect`, `--isolated`, or a target. `--isolated` is deprecated (accepted; hidden from help). - **Migration** - To reuse an existing Chrome: `browse env local --auto-connect`. - To attach to a specific target: `browse env local <port|url>`. - No changes if you want a clean isolated browser by default. <sup>Written for commit a132cb1. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/1945">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. -->
Prepare the next browse-cli release by versioning the package on `main`. What this PR does: - bumps `packages/cli/package.json` to `0.5.0` - updates the browse-cli changelog - consumes the pending browse-cli changesets After this PR merges, the `Release` workflow on `main` will publish `@browserbasehq/browse-cli@0.5.0` from that exact commit using `pnpm pack` + `npm publish --provenance`. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Publish `@browserbasehq/browse-cli@0.5.0`, defaulting `browse env local` to an isolated browser and adding `--auto-connect` to opt into attaching to an existing debuggable Chrome; explicit CDP attach via `browse env local <port|url>` remains unchanged. - **Migration** - If you previously relied on auto-attach, run: `browse env local --auto-connect`. <sup>Written for commit 795c005. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/1946">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ters (browserbase#1935) ## Summary - Add global CLI flags for commonly used Browserbase session parameters to the `browse` CLI - Users no longer need external tools or workarounds to configure `advancedStealth`, `proxies`, `solveCaptchas`, etc. - Flags are remote-mode only and trigger daemon restart when changed ### New flags | Flag | Description | |------|-------------| | `--proxies` | Enable Browserbase proxy | | `--advanced-stealth` | Enable advanced stealth mode | | `--solve-captchas` / `--no-solve-captchas` | Toggle CAPTCHA solving | | `--region <region>` | Session region | | `--keep-alive` | Keep session alive after disconnection | | `--session-timeout <seconds>` | Session timeout | | `--block-ads` | Enable ad blocking | ### Examples ```bash browse --proxies --advanced-stealth open https://example.com browse --region us-east-1 --solve-captchas open https://example.com ``` Session flags are validated to only work in remote mode and will error with a helpful message if used in local mode. Linear: https://linear.app/browserbase/issue/STG-1741/featcli-add-global-flags-for-browserbase-session-parameters ## Test plan - [ ] `browse --help` shows new flags with "(remote only)" descriptions - [ ] `browse --proxies open https://example.com` (in remote mode) creates session with proxy enabled - [ ] `browse --advanced-stealth --solve-captchas open https://example.com` configures both settings - [ ] `browse --proxies open https://example.com` (in local mode) errors with helpful message - [ ] Changing flags restarts the daemon automatically - [ ] `browse status` shows active session params - [ ] Build succeeds 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Add global flags to `browse` to configure Browserbase session settings in remote mode (proxies, stealth, CAPTCHA solving, region, keep-alive, timeouts) without JSON. Settings persist per session, trigger a daemon restart when changed, and appear as `sessionParams` in `browse status` JSON; also fixes lint errors. Addresses Linear STG-1741. - **New Features** - Flags: `--proxies`, `--advanced-stealth`, `--solve-captchas`/`--no-solve-captchas`, `--block-ads`, `--region <region>`, `--keep-alive`, `--session-timeout <seconds>`; remote-only with a clear error in local mode <sup>Written for commit 064c0e4. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/1935">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. --> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
## Summary - Adds `browse upload <selector> <files...>` command to upload files to `<input type="file">` elements - Uses Understudy's `setInputFiles` under the hood, which handles both local (CDP `DOM.setFileInputFiles`) and remote/Browserbase (base64 payload injection) paths automatically - Supports ref-based selectors from `browse snapshot` (e.g., `browse upload @0-5 ./doc.pdf`) - Supports multiple files: `browse upload @0-5 ./a.png ./b.png` ## Usage ```bash browse upload <selector> <file> # single file browse upload @0-5 ./document.pdf # using ref from snapshot browse upload @0-5 ./a.png ./b.png # multiple files ``` ## Test plan - [X] Test single file upload on a local page with `<input type="file">` - [X] Test multiple file upload - [X] Test with ref-based selector from snapshot - [X] Test on remote Browserbase session (base64 injection path) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e#1951) # why Stainless generated clients had custom code changes that shouldn't have been custom code, they should've bene updated in the api spec. This fixes the root cause by replacing those, and then I'll have a follow-up PR for the python sdk to remove those custom code changes. # what changed # test plan <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Updated v3 API examples to use OpenAI `openai/gpt-5.4-mini`, replacing previous defaults across the OpenAPI spec, core types, and `stainless.yml`. This aligns examples with our base URL and API key docs and avoids custom patches in Stainless-generated clients; no behavior changes. <sup>Written for commit b6d9710. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/1951">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. -->
…e#1952) ## Summary - Renamed `@browserbasehq/mcp-server-browserbase` to `@browserbasehq/mcp` in v2 and v3 MCP docs (setup and configuration pages) ## Linear [STG-1769](https://linear.app/browserbase/issue/STG-1769/rename-mcp-package-in-docs) ## Test plan - [ ] Verify v2 docs render correctly with new package name - [ ] Verify v3 docs render correctly with new package name 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Renamed the MCP package in v2 and v3 docs from `@browserbasehq/mcp-server-browserbase` to `@browserbasehq/mcp`, updating setup and configuration examples and CLI notes. Also removed an unnecessary changeset since this is docs-only, aligning with STG-1769. <sup>Written for commit 501df49. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/1952">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. --> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
## Summary - Remove all `BROWSERBASE_PROJECT_ID` / `projectId` references from v3 docs, SDK docs, integration guides, migration guides, and CLI README (30 files) - Only `BROWSERBASE_API_KEY` is required — `projectId` is optional in all code control paths (conditionally included via spread patterns, never validated as required) - Preserves unrelated GCP project ID references in `models.mdx` ## Test plan - [ ] Verify docs site builds without errors - [ ] Spot-check code examples still make sense without projectId - [ ] Confirm no broken references or formatting issues 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Removed all `BROWSERBASE_PROJECT_ID`/`projectId` references across v3 docs so setup only requires `BROWSERBASE_API_KEY`. Also updated Anthropic model references to `anthropic/claude-sonnet-4-6` across examples and guides. - **Migration** - Remove `BROWSERBASE_PROJECT_ID` from env files, deployment configs, session params, and env var lists; keep `BROWSERBASE_API_KEY` only. - Existing code passing `projectId` still works; it’s optional and not required. - Unrelated GCP project ID mentions remain unchanged. - **Refactors** - Replaced all `anthropic/claude-sonnet-4-20250514` references with `anthropic/claude-sonnet-4-6` across v3 docs (agent examples, warnings, best practices). - Simplified MCP config by removing the `CardGroup` wrapper around a single card. <sup>Written for commit 7a1688d. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/1958">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. --> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update act.mdx and agent.mdx in the basics section to use the
simplified model string format ("provider/model") instead of the
verbose object format ({ modelName, apiKey }), matching the changes
already applied to best-practices in PR browserbase#1959.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
"provider/model") instead of the verbose object format ({ modelName, apiKey })Test plan
🤖 Generated with Claude Code