Repository navigation
Make browser session ownership and facade mounts explicit - #2892
Merged
miguelg719 merged 10 commits intoSep 17, 2026
Merged
miguelg719 merged 10 commits into
miguelg719 merged 10 commits into
Conversation
🦋 Changeset detectedLatest commit: 6c1c5d9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 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 |
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 26 files
Architecture diagram
sequenceDiagram
participant Harness as Eval Harness
participant FacadeTool as StagehandFacadeTool
participant Bridge as Facade Bridge
participant FacadeProc as Facade Process
participant SDK as Stagehand SDK
participant BB as Browserbase
participant Mt as Agent MCP Client
Note over Harness,BB: Browser Session Ownership & Lifecycle
Harness->>FacadeTool: start(environment=BROWSERBASE)
alt Shared extension upload enabled
FacadeTool->>BB: acquireRunScopedStagehandExtension()
BB-->>FacadeTool: extensionId + release()
FacadeTool->>FacadeProc: STAGEHAND_BROWSERBASE_EXTENSION_ID env
end
FacadeTool->>Bridge: startStagehandFacadeBridge()
Bridge->>FacadeProc: spawn stdio server (--surface=playwright|legacy)
FacadeProc->>SDK: Stagehand.create()
SDK->>BB: connectBrowser(origin=launched, keepAlive=true)
BB-->>SDK: sessionId
alt CDP attach fails
SDK->>BB: closeSession() (NEW: release owned session)
BB-->>SDK: session closed
SDK-->>FacadeProc: startup error
FacadeProc-->>Bridge: exit
Bridge-->>FacadeTool: start error
FacadeTool->>BB: release() shared extension
else CDP attach succeeds
BB-->>SDK: CDP connected
SDK-->>FacadeProc: session ready
FacadeProc-->>Bridge: session_info tool result
Bridge-->>FacadeTool: { provider, sessionId }
FacadeTool-->>Harness: metadata.browserbaseSessionId/Url
end
Note over Harness,BB: Agent Tool Calls via MCP
Mt->>Bridge: MCP connect (agent mount)
Mt->>FacadeProc: tools/call "run" | "snapshot" | "screenshot"
FacadeProc->>SDK: activePage()
alt Page vanished or crashed
FacadeProc->>SDK: get fresh page (keeper tab survives)
SDK-->>FacadeProc: new page
end
SDK-->>FacadeProc: result
FacadeProc-->>Mt: tool result
Note over Harness,BB: Runner-Initiated Tool Calls (NEW)
Harness->>FacadeTool: callTool("screenshot")
FacadeTool->>Bridge: callTool()
Bridge->>FacadeProc: tools/call (same facade, no new browser)
FacadeProc-->>Bridge: content blocks + isError
alt Browser session lost
FacadeProc->>FacadeProc: detect CDP loss
FacadeProc-->>Bridge: stderr: stagehand_facade_session_lost {...}
Bridge->>Bridge: parseSessionLossTelemetry()
Bridge-->>FacadeTool: browserSessionLoss()
FacadeProc-->>Mt: "Browser session lost (...)" error
end
Note over Harness,BB: Cleanup & Session Release
Harness->>FacadeTool: cleanup()
FacadeTool->>Bridge: close()
Bridge->>FacadeProc: terminate stdio
FacadeProc->>SDK: browser.close()
SDK->>BB: closeSession() (explicit release)
BB-->>SDK: session ended
FacadeTool->>FacadeTool: session.close()
FacadeTool->>BB: release() shared extension
FacadeTool-->>Harness: cleanup complete
Note over Harness,BB: Session Loss During Transport Failure
opt CDP transport drops but session alive
SDK-->>SDK: keepAlive=true prevents auto-close
Mt->>FacadeProc: next tool call
FacadeProc->>SDK: reconnect CDP
SDK-->>FacadeProc: session still valid
end
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
…ion-02-session-ownership
…ion-02-session-ownership
…ion-02-session-ownership
…ion-02-session-ownership
akeimach
approved these changes
Sep 9, 2026
miguelg719
commented
Sep 14, 2026
This was referenced Sep 17, 2026
miguelg719
added a commit
that referenced
this pull request
Sep 17, 2026
Aligns the shared facade’s label matching, strict locator operations and URL waits with supported Playwright behavior. All consuming harnesses get these semantics through the same facade. Scoped role matches now follow shadow hosts instead of relying on DOM containment. CSS, label, and snapshot-derived queries can access closed author shadow roots through a narrow extension batch operation. Temporary CDP references are released best-effort after each query; fixed typed errors avoid exposing page exception text, and the evaluator remains off the public SDK type; locator callbacks continue to execute in the page main world. The Go-embedded extension is rebuilt to match. Adds local-browser comparisons against native Playwright alongside deterministic URL-wait tests. Frame composition is isolated in the next change. Checkbox probes share the operation timeout; nested role filters are resolved before matching. The real DOM contract suite is registered in Turbo. Validation: 144 shared integration unit tests, five local Chrome DOM tests, and 19 callback/shadow-reference tests pass. The new open/closed-root regressions fail against the previous implementation. A real Stagehand SDK + local extension smoke passes scoped lookup, fill, click, and main-world callback checks inside a closed root. Extension, SDK, integration, and eval typechecks pass; extension/integration builds, formatting, and Go extension drift check pass. Stack position: 3/11. Base: `evals/consolidation-02-session-ownership`. Each PR contains the change relative to its immediate predecessor. Reviewer entry points: - [`packages/integrations/core/src/facade/runtime.ts`](https://github.com/browserbase/stagehand/blob/f484d008abb8e0ef5950ffa39bcbee98b84e0fe2/packages/integrations/core/src/facade/runtime.ts) - [`packages/integrations/core/integration/facade-dom.test.ts`](https://github.com/browserbase/stagehand/blob/f484d008abb8e0ef5950ffa39bcbee98b84e0fe2/packages/integrations/core/integration/facade-dom.test.ts) - [`packages/integrations/core/tests/facade-wait-for-url.test.ts`](https://github.com/browserbase/stagehand/blob/f484d008abb8e0ef5950ffa39bcbee98b84e0fe2/packages/integrations/core/tests/facade-wait-for-url.test.ts) Reordered stack: #2891 → #2892 → #2895 → #2896 → #2897 → #2898 → #2899 → #2900 → #2901 → #2893 → #2894. Readiness: [CI passed](https://github.com/browserbase/stagehand/actions/runs/35193871165) on `f484d008ab`. Review threads are triaged and resolved.
miguelg719
added a commit
that referenced
this pull request
Sep 17, 2026
Composes facade locators through same-origin and out-of-process frames and preserves global snapshot references without duplicating unresolved frame maps. Adds operator documentation for ownership. Deadline and disconnect documentation follows in #2893 and #2894. Also repairs failures exposed by stack CI: - Background-tab screenshots activate their target and serialize activation/capture across the browser. Setup and cleanup are serialized per page, so a stalled page cannot block other tabs. Capture deadlines stop waiting for stalled CDP responses; late responses cannot re-enter cleanup. Calls on a page with unfinished timeout recovery fail promptly until cleanup settles, after which screenshots resume. - The Vantech Journal scorer identifies the archive’s Load more link by destination and text instead of an obsolete absolute XPath. Strict DOM element-identity scoring and the 80% gate remain unchanged. - CLI test deadlines account for the bounded child processes they launch, including multi-command tests. Validation: 24 local screenshot/lifecycle tests and 66 CLI/help tests passed, along with relevant typechecks and Go extension archive checks. Tests cover timeout rejection, isolation across tabs, and recovery after delayed setup/cleanup settles. Live Chrome verification accepts the recorded correct Vantech observation and rejects an unrelated element. Stack position: 4/11. Base: `evals/consolidation-05-locator-wait-contract`. Reviewer entry points: - [Frame facade implementation](https://github.com/browserbase/stagehand/blob/6d79622f5a518b134c1c725e88dd0594d337bff3/packages/integrations/core/src/facade/runtime.ts) - [Snapshot frame maps](https://github.com/browserbase/stagehand/blob/6d79622f5a518b134c1c725e88dd0594d337bff3/packages/extension/understudy/a11y/snapshot/capture.ts) - [Screenshot lifecycle](https://github.com/browserbase/stagehand/blob/6d79622f5a518b134c1c725e88dd0594d337bff3/packages/extension/understudy/page.ts) - [Archive scorer](https://github.com/browserbase/stagehand/blob/6d79622f5a518b134c1c725e88dd0594d337bff3/packages/evals/tasks/bench/observe/observe_vantechjournal.ts) Reordered stack: #2891 → #2892 → #2895 → #2896 → #2897 → #2898 → #2899 → #2900 → #2901 → #2893 → #2894. Readiness: [CI passed](https://github.com/browserbase/stagehand/actions/runs/35194404031) on `6d79622f5a`. Review threads are triaged and resolved.
miguelg719
added a commit
that referenced
this pull request
Sep 17, 2026
Bounds stalled DeepAgents setup, stream waits and cleanup. Timeout settings reject invalid values, preserve the original stop reason and finish cleanup without losing a completed tool-result batch. MCP setup, stream and cleanup timeouts preserve AnyIO task ownership; real in-memory MCP sessions cover the cancel-scope regression and cleanup deadlines. Validation: 35 Python runner tests; 29 Python tests and Python compilation passed, including stalled MCP acquisition/tool discovery, competing wall/inactivity deadlines, invalid timeout inputs, and cleanup. Stack position: 5/11. Base: `evals/consolidation-06-frame-support`. Each PR contains the change relative to its immediate predecessor. Reviewer entry points: - [`packages/integrations/deepagents/runner/run_eval.py`](https://github.com/browserbase/stagehand/blob/d1d6e48fd946158a042501aad592eb21b01e8481/packages/integrations/deepagents/runner/run_eval.py) - [`packages/integrations/deepagents/runner/tests/test_run_eval.py`](https://github.com/browserbase/stagehand/blob/d1d6e48fd946158a042501aad592eb21b01e8481/packages/integrations/deepagents/runner/tests/test_run_eval.py) Follow-up review validation: 40 Python tests pass. Timeout attribution now distinguishes the runner’s expired deadline from inner MCP/provider `TimeoutError`, preserves subsecond diagnostic values, and records the selected watchdog before cancellation cleanup. Same-task MCP/AnyIO ownership is preserved. The alleged early-expiry arithmetic was not confirmed; a separate slow-cleanup attribution regression is covered. Reordered stack: #2891 → #2892 → #2895 → #2896 → #2897 → #2898 → #2899 → #2900 → #2901 → #2893 → #2894. Readiness: [CI passed](https://github.com/browserbase/stagehand/actions/runs/35195059814) on `d1d6e48fd9`. Review threads are triaged and resolved.
miguelg719
added a commit
that referenced
this pull request
Sep 17, 2026
Routes direct Mastra and DeepAgents model requests through the intended native provider while respecting explicit gateway routing. Missing provider configuration remains an actionable startup error. Missing xAI credentials fail before client construction, preventing fallback to another provider’s ambient key. Validation: 41 Python runner tests including synthetic cross-provider credential regressions; 32 Python tests, 18 Mastra routing/session tests, five build tasks, frozen dependency installation, and Mastra typecheck passed. Stack position: 6/11. Base: `evals/consolidation-07-deepagents-lifecycle`. Each PR contains the change relative to its immediate predecessor. Reviewer entry points: - [`packages/integrations/mastra-sdk/src/session.ts`](https://github.com/browserbase/stagehand/blob/5caa682dca8269b7772a71ad530f4a9ccea87956/packages/integrations/mastra-sdk/src/session.ts) - [`packages/integrations/mastra-sdk/tests/model-routing.test.ts`](https://github.com/browserbase/stagehand/blob/5caa682dca8269b7772a71ad530f4a9ccea87956/packages/integrations/mastra-sdk/tests/model-routing.test.ts) - [`packages/integrations/deepagents/runner/run_eval.py`](https://github.com/browserbase/stagehand/blob/5caa682dca8269b7772a71ad530f4a9ccea87956/packages/integrations/deepagents/runner/run_eval.py) Reordered stack: #2891 → #2892 → #2895 → #2896 → #2897 → #2898 → #2899 → #2900 → #2901 → #2893 → #2894. Readiness: [CI passed](https://github.com/browserbase/stagehand/actions/runs/35195660877) on `5caa682dca`. Review threads are triaged and resolved.
miguelg719
added a commit
that referenced
this pull request
Sep 17, 2026
Bounds retained SDK event logs while keeping actionable diagnostics and trajectory evidence. Pi screenshot compaction and its Buffer-aware trajectory consumer land together, preventing intermediate screenshot loss. Validation: 118 SDK/event tests, five Pi adapter/pipeline tests, 12 build tasks, and SDK/core/eval typechecks passed. The pipeline test imports the actual built Pi compactor and checks retained image bytes for compacted Buffer and historical base64 events. Stack position: 7/11. Base: `evals/consolidation-08-native-routing`. Each PR contains the change relative to its immediate predecessor. Reviewer entry points: - [`packages/integrations/core/src/harness/eventLog.ts`](https://github.com/browserbase/stagehand/blob/bfc240ec68d562c190885bc676c57ac6360f835b/packages/integrations/core/src/harness/eventLog.ts) - [`packages/integrations/pi-sdk/src/session.ts`](https://github.com/browserbase/stagehand/blob/bfc240ec68d562c190885bc676c57ac6360f835b/packages/integrations/pi-sdk/src/session.ts) - [`packages/evals/framework/harnesses/piAdapter.ts`](https://github.com/browserbase/stagehand/blob/bfc240ec68d562c190885bc676c57ac6360f835b/packages/evals/framework/harnesses/piAdapter.ts) <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Bounds SDK event logs and retained event payloads across Claude, Codex, DeepAgents, Eve, Fx, Mastra, and Pi. Previously, stream noise and repeated payloads stayed visible; now stream fragments are dropped, routine events move to debug, and failures stay at level 1 without changing model-facing results or trajectory evidence. - Adds a shared event classifier that drops deltas and bare lifecycle markers and keeps SDK-specific failures visible. - Retains Pi screenshots once as `Buffer` values, drops duplicate image payloads from logs and non-assistant messages, and records omission markers over 8 MiB per image or 64 MiB per run. The Pi adapter accepts both `Buffer` and legacy base64 image blocks. - Compacts Mastra `step-finish` and `finish` events to keep usage and trajectory data without repeated request bodies. - Redacts credentials before clipping event details. <sup>Written for commit bfc240e. Summary will update on new commits.</sup> <a href="https://cubic.dev/pr/browserbase/stagehand/pull/2899?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. --> Reordered stack: #2891 → #2892 → #2895 → #2896 → #2897 → #2898 → #2899 → #2900 → #2901 → #2893 → #2894. Readiness: [CI passed](https://github.com/browserbase/stagehand/actions/runs/35196277234) on `bfc240ec68`. Review threads are triaged and resolved.
miguelg719
added a commit
that referenced
this pull request
Sep 17, 2026
Distinguishes unreported usage from observed zero across SDK boundaries and recovers interrupted Codex usage without replacing authoritative completed-turn counts. Eval accounting consumes this metadata in the later adoption PR. Validation: 167 SDK tests, 38 Python tests, 12 build tasks, and SDK/core/eval typechecks passed. Authoritative completed Codex usage takes precedence over interrupted-rollout recovery. Stack position: 8/11. Base: `evals/consolidation-09-event-retention`. Each PR contains the change relative to its immediate predecessor. Reviewer entry points: - [`packages/integrations/codex-sdk/src/session.ts`](https://github.com/browserbase/stagehand/blob/b60164d6a5155900c83880a04c0767cab915c562/packages/integrations/codex-sdk/src/session.ts) - [`packages/integrations/deepagents/runner/run_eval.py`](https://github.com/browserbase/stagehand/blob/b60164d6a5155900c83880a04c0767cab915c562/packages/integrations/deepagents/runner/run_eval.py) - [`packages/integrations/mastra-sdk/src/session.ts`](https://github.com/browserbase/stagehand/blob/b60164d6a5155900c83880a04c0767cab915c562/packages/integrations/mastra-sdk/src/session.ts) Reordered stack: #2891 → #2892 → #2895 → #2896 → #2897 → #2898 → #2899 → #2900 → #2901 → #2893 → #2894. Readiness: [CI passed](https://github.com/browserbase/stagehand/actions/runs/35197720052) on `b60164d6a5`. Review threads are triaged and resolved.
miguelg719
added a commit
that referenced
this pull request
Sep 17, 2026
…#2901) Separates verified task completion from execution health. Verification errors fail closed, preserve the agent report separately, and retain captured evidence and raw uncertainty for audit. A supported completion can still pass after a late browser disconnect. Preserves judge verdicts beside deterministic evidence gates; missing criterion scores remain in the denominator. Blocker wording and execution error alone do not erase a completed rubric requirement. Numeric grounding remains advisory by default. It includes captured step and terminal accessibility text, records terminal matches separately, and treats unknown-page text as untrusted. Batch summaries expose explicit zero-browser passes; the configured verifiability gate rejects them. Producer-dependent usage, cost, facade and lifecycle fields are documented as conditional. Offline verification uses the same model factory as live grading: CLI override, then EVAL_VERIFIER_MODEL, then the shared default. Thrown verification errors and uncertain judgments are preserved as explicit ungraded artifacts without top-level outcome/process scores, including live persistence and tracing; the offline command exits unsuccessfully. Trace labels are restricted to filename components, and failed writes emit sanitized warnings. Judge policy still needs confirmation: this proposed change selects google/gemini-3.5-flash by default, while current main uses 2.5 Flash. The completed 108-case compatibility gate explicitly used 2.5 Flash and does not validate the proposed 3.5 default. Validation: 104 focused verifier/CLI/span/persistence/summary tests at this boundary, eval typecheck and scoped formatting; 13 assertions reproduced the new review gaps before fixes. No frozen 108-case compatibility inputs changed. No evaluator-v4 implementation. Stack position: 9/11. Base: `evals/consolidation-10-usage-provenance`. Each PR contains the change relative to its immediate predecessor. Reviewer entry points: - [`packages/evals/framework/verifierAdapter.ts`](https://github.com/browserbase/stagehand/blob/af1cf703925647db722d166cafc75bcfbe3f36df/packages/evals/framework/verifierAdapter.ts) - [`packages/evals/framework/verifierGates.ts`](https://github.com/browserbase/stagehand/blob/af1cf703925647db722d166cafc75bcfbe3f36df/packages/evals/framework/verifierGates.ts) - [`packages/evals/docs/verifier-gates.md`](https://github.com/browserbase/stagehand/blob/af1cf703925647db722d166cafc75bcfbe3f36df/packages/evals/docs/verifier-gates.md) Reordered stack: #2891 → #2892 → #2895 → #2896 → #2897 → #2898 → #2899 → #2900 → #2901 → #2893 → #2894. Readiness: reordered head `af1cf70392` is awaiting fresh CI and review triage.
This was referenced Sep 17, 2026
This was referenced Sep 18, 2026
miguelg719
added a commit
that referenced
this pull request
Oct 4, 2026
…2893) Bounds capture and RPC/batch waits. Two consecutive capture deadlines are recoverable; a third latches terminal session loss, while a successful tool call resets the counter. Late completion cannot overwrite newer snapshot IDs. Terminal loss rejects queued calls without dispatch. Actions are never automatically replayed. Regressions cover bounded timeout inputs, late completion, counter reset, screenshot transport and first-loss handling. `experimentalBatch` keeps its single `timeout` option (the callback deadline the browser-side executor enforces). The client bounds the whole round trip at `timeout` plus a 15-second batch grace (`CALLBACK_BATCH_CLIENT_GRACE_MS`), because the executor's timeout is cooperative and can be reported late. A batch that gets no response by then rejects with `StagehandBatchTimeoutError`; RPC response deadlines throw `RPCResponseTimeoutError`. Earlier revisions also exposed that local deadline as a `clientTimeoutMs` option. Nothing passed it, so it is removed; the default it produced is unchanged. The facade now calls `page.snapshot()` with `timeout: 0`. Snapshot gained a 20-second default on main, which fired before the facade's 120-second capture deadline, so a slow snapshot failed as an ordinary tool error and never counted toward terminal session loss. Preserves provider/session/age/timeout diagnostics through the host, checks screenshot byte limits before decoding, and isolates failures in diagnostic observers. The typed RPC timeout error lives in a focused public module, keeping internal RPC helpers outside the SDK public-field contract. Validation: 120 focused tests and 47 SDK AST/release guards, SDK/core/eval typechecks, SDK build/publint, and merged ownership/capture regression checks. At `b14e4ec95`: 345 SDK unit tests and 156 facade unit tests pass, with SDK and facade typechecks and the format check clean. Stack base: `main`. Review this PR relative to its immediate predecessor. Reviewer entry points: - [`packages/integrations/core/src/facade/tools.ts`](https://github.com/browserbase/stagehand/blob/b14e4ec95e40a44fb9c0ec87383b060a10d4fab6/packages/integrations/core/src/facade/tools.ts) - [`packages/sdk-ts/src/batch.ts`](https://github.com/browserbase/stagehand/blob/b14e4ec95e40a44fb9c0ec87383b060a10d4fab6/packages/sdk-ts/src/batch.ts) - [`packages/integrations/core/tests/facade-tools.test.ts`](https://github.com/browserbase/stagehand/blob/b14e4ec95e40a44fb9c0ec87383b060a10d4fab6/packages/integrations/core/tests/facade-tools.test.ts) The CLI startup fix is now included in the parent (#2892), so this PR focuses on capture/RPC deadlines and recovery. Current main is incorporated, preserving both the timeout exports and the runtime-compatibility exports. Readiness: CI is running on `b14e4ec95e`; it last passed on `65d9c911b7` ([run](https://github.com/browserbase/stagehand/actions/runs/36969426716)). The one cubic comment (snapshot timeout) is fixed and resolved. Human review status is unchanged. Current open stack: #2893 → #2894 → #2902 → #2903 → #2889 → #2904 → #2905 → #2906 → #2907.
seanmcguire12
pushed a commit
that referenced
this pull request
Oct 8, 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/[email protected] ### Minor Changes - [#2821](#2821) [`a237c77`](a237c77) Thanks [@shrey150](https://github.com/shrey150)! - Replace the Eve extension's browser and web tools with Stagehand V4 `run`, `snapshot`, and `screenshot`. ### Patch Changes - [#3115](#3115) [`7abca76`](7abca76) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - update the Eve peer dependency to ^0.71.2 to use upstream security fixes. Requires Eve 0.71.2 or later within the 0.71.x release line. - Updated dependencies [[`34edfa3`](34edfa3), [`a837acf`](a837acf), [`4da1a21`](4da1a21), [`5802f59`](5802f59), [`819db28`](819db28), [`0210688`](0210688), [`666b6fa`](666b6fa), [`f3543d3`](f3543d3), [`f2060a6`](f2060a6), [`1562d35`](1562d35), [`7d8dcef`](7d8dcef), [`476658b`](476658b), [`70f4e91`](70f4e91)]: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Minor Changes - [#3030](#3030) [`34edfa3`](34edfa3) Thanks [@supremeboxlogos](https://github.com/supremeboxlogos)! - Export browser pages as PDF bytes in TypeScript, Python, and Go, with configurable print settings and timeouts, and optional local file saving in TypeScript and Python. - [#3118](#3118) [`a837acf`](a837acf) Thanks [@miguelg719](https://github.com/miguelg719)! - Add `clientOptions` to `browserbase.launch()` and `browserbase.connect()`. Thanks to [@pr1m8](https://github.com/pr1m8) for the original proposal that motivated this feature. - [#3083](#3083) [`666b6fa`](666b6fa) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - expose a timeout option for page.snapshot() across all sdks, defaulting to 20 seconds. set it to 0 for unlimited execution. one budget covers the whole snapshot capture. - [#3140](#3140) [`f2060a6`](f2060a6) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - automatically discover Stagehand extensions when connecting to browsers. deprecate & ignore extension IDs passed into .connect(). - [#2916](#2916) [`476658b`](476658b) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - add page level hooks for webmcp tools added and webmcp tools removed events. ### Patch Changes - [#3045](#3045) [`4da1a21`](4da1a21) Thanks [@github-actions](https://github.com/apps/github-actions)! - Keep telemetry disabled unless an OTLP traces endpoint is explicitly configured. - [#2893](#2893) [`5802f59`](5802f59) Thanks [@miguelg719](https://github.com/miguelg719)! - Bound experimental batch and RPC deadlines so callers can stop waiting without replaying actions or accepting late capture state. - [#2894](#2894) [`819db28`](819db28) Thanks [@miguelg719](https://github.com/miguelg719)! - Add configurable bounded CDP heartbeats and sanitized disconnect diagnostics with cleanup on shutdown. - [#2892](#2892) [`0210688`](0210688) Thanks [@miguelg719](https://github.com/miguelg719)! - Release a newly created Browserbase session when initial attachment fails, and support upload retries - [#2978](#2978) [`f3543d3`](f3543d3) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - Fix locator failures when entering loading iframes, and correctly target iframe elements when an XPath ends at the iframe. - [#3033](#3033) [`1562d35`](1562d35) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - add per-call locator timeouts across TypeScript, Python, & Go. one timeout covers frame readiness, element lookup, & execution, including typing delays & highlight duration. the default is 20 seconds. setting timeout to 0 disables it. - [#3146](#3146) [`7d8dcef`](7d8dcef) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - Make selector waits include frame readiness in their timeout, support unlimited waits with `timeout: 0`, and clean up observers when the wait ends. - [#3052](#3052) [`70f4e91`](70f4e91) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - Match native XPath semantics for `text()` predicates when a shadow root routes locators through the composed-tree parser ## @browserbasehq/[email protected] ### Minor Changes - [#3030](#3030) [`34edfa3`](34edfa3) Thanks [@supremeboxlogos](https://github.com/supremeboxlogos)! - Export browser pages as PDF bytes in TypeScript, Python, and Go, with configurable print settings and timeouts, and optional local file saving in TypeScript and Python. - [#3083](#3083) [`666b6fa`](666b6fa) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - expose a timeout option for page.snapshot() across all sdks, defaulting to 20 seconds. set it to 0 for unlimited execution. one budget covers the whole snapshot capture. - [#2916](#2916) [`476658b`](476658b) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - add page level hooks for webmcp tools added and webmcp tools removed events. ### Patch Changes - [#3045](#3045) [`4da1a21`](4da1a21) Thanks [@github-actions](https://github.com/apps/github-actions)! - Keep telemetry disabled unless an OTLP traces endpoint is explicitly configured. - [#2896](#2896) [`7919934`](7919934) Thanks [@miguelg719](https://github.com/miguelg719)! - Snapshot references remain valid across same-origin and out-of-process frame captures - [#2978](#2978) [`f3543d3`](f3543d3) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - Fix locator failures when entering loading iframes, and correctly target iframe elements when an XPath ends at the iframe. - [#3033](#3033) [`1562d35`](1562d35) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - add per-call locator timeouts across TypeScript, Python, & Go. one timeout covers frame readiness, element lookup, & execution, including typing delays & highlight duration. the default is 20 seconds. setting timeout to 0 disables it. - [#3146](#3146) [`7d8dcef`](7d8dcef) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - Make selector waits include frame readiness in their timeout, support unlimited waits with `timeout: 0`, and clean up observers when the wait ends. - [#3052](#3052) [`70f4e91`](70f4e91) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - Match native XPath semantics for `text()` predicates when a shadow root routes locators through the composed-tree parser ## @browserbasehq/[email protected] ### Minor Changes - [#3030](#3030) [`34edfa3`](34edfa3) Thanks [@supremeboxlogos](https://github.com/supremeboxlogos)! - Export browser pages as PDF bytes in TypeScript, Python, and Go, with configurable print settings and timeouts, and optional local file saving in TypeScript and Python. - [#3083](#3083) [`666b6fa`](666b6fa) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - expose a timeout option for page.snapshot() across all sdks, defaulting to 20 seconds. set it to 0 for unlimited execution. one budget covers the whole snapshot capture. - [#2916](#2916) [`476658b`](476658b) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - add page level hooks for webmcp tools added and webmcp tools removed events. ### Patch Changes - [#3045](#3045) [`4da1a21`](4da1a21) Thanks [@github-actions](https://github.com/apps/github-actions)! - Keep telemetry disabled unless an OTLP traces endpoint is explicitly configured. - [#3033](#3033) [`1562d35`](1562d35) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - add per-call locator timeouts across TypeScript, Python, & Go. one timeout covers frame readiness, element lookup, & execution, including typing delays & highlight duration. the default is 20 seconds. setting timeout to 0 disables it. ## @browserbasehq/[email protected] ### Minor Changes - [#3030](#3030) [`34edfa3`](34edfa3) Thanks [@supremeboxlogos](https://github.com/supremeboxlogos)! - Export browser pages as PDF bytes in TypeScript, Python, and Go, with configurable print settings and timeouts, and optional local file saving in TypeScript and Python. - [#3123](#3123) [`100e201`](100e201) Thanks [@miguelg719](https://github.com/miguelg719)! - Add `ClientOptions` to `LaunchBrowserbase` and `ConnectBrowserbase`. - [#3083](#3083) [`666b6fa`](666b6fa) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - expose a timeout option for page.snapshot() across all sdks, defaulting to 20 seconds. set it to 0 for unlimited execution. one budget covers the whole snapshot capture. - [#3140](#3140) [`f2060a6`](f2060a6) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - automatically discover Stagehand extensions when connecting to browsers. deprecate & ignore extension IDs passed into .connect(). - [#2916](#2916) [`476658b`](476658b) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - add page level hooks for webmcp tools added and webmcp tools removed events. ### Patch Changes - [#3045](#3045) [`4da1a21`](4da1a21) Thanks [@github-actions](https://github.com/apps/github-actions)! - Keep telemetry disabled unless an OTLP traces endpoint is explicitly configured. - [#2896](#2896) [`7919934`](7919934) Thanks [@miguelg719](https://github.com/miguelg719)! - Snapshot references remain valid across same-origin and out-of-process frame captures - [#2978](#2978) [`f3543d3`](f3543d3) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - Fix locator failures when entering loading iframes, and correctly target iframe elements when an XPath ends at the iframe. - [#3033](#3033) [`1562d35`](1562d35) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - add per-call locator timeouts across TypeScript, Python, & Go. one timeout covers frame readiness, element lookup, & execution, including typing delays & highlight duration. the default is 20 seconds. setting timeout to 0 disables it. - [#3146](#3146) [`7d8dcef`](7d8dcef) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - Make selector waits include frame readiness in their timeout, support unlimited waits with `timeout: 0`, and clean up observers when the wait ends. - [#3052](#3052) [`70f4e91`](70f4e91) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - Match native XPath semantics for `text()` predicates when a shadow root routes locators through the composed-tree parser ## @browserbasehq/[email protected] ### Minor Changes - [#3030](#3030) [`34edfa3`](34edfa3) Thanks [@supremeboxlogos](https://github.com/supremeboxlogos)! - Export browser pages as PDF bytes in TypeScript, Python, and Go, with configurable print settings and timeouts, and optional local file saving in TypeScript and Python. - [#3118](#3118) [`a837acf`](a837acf) Thanks [@miguelg719](https://github.com/miguelg719)! - Add `client_options` to `browserbase.launch()` and `browserbase.connect()`. - [#3083](#3083) [`666b6fa`](666b6fa) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - expose a timeout option for page.snapshot() across all sdks, defaulting to 20 seconds. set it to 0 for unlimited execution. one budget covers the whole snapshot capture. - [#3140](#3140) [`f2060a6`](f2060a6) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - automatically discover Stagehand extensions when connecting to browsers. deprecate & ignore extension IDs passed into .connect(). - [#2916](#2916) [`476658b`](476658b) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - add page level hooks for webmcp tools added and webmcp tools removed events. ### Patch Changes - [#3045](#3045) [`4da1a21`](4da1a21) Thanks [@github-actions](https://github.com/apps/github-actions)! - Keep telemetry disabled unless an OTLP traces endpoint is explicitly configured. - [#2978](#2978) [`f3543d3`](f3543d3) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - Fix locator failures when entering loading iframes, and correctly target iframe elements when an XPath ends at the iframe. - [#3033](#3033) [`1562d35`](1562d35) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - add per-call locator timeouts across TypeScript, Python, & Go. one timeout covers frame readiness, element lookup, & execution, including typing delays & highlight duration. the default is 20 seconds. setting timeout to 0 disables it. - [#3146](#3146) [`7d8dcef`](7d8dcef) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - Make selector waits include frame readiness in their timeout, support unlimited waits with `timeout: 0`, and clean up observers when the wait ends. - [#3052](#3052) [`70f4e91`](70f4e91) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - Match native XPath semantics for `text()` predicates when a shadow root routes locators through the composed-tree parser ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies [[`34edfa3`](34edfa3), [`a837acf`](a837acf), [`4da1a21`](4da1a21), [`5802f59`](5802f59), [`819db28`](819db28), [`0210688`](0210688), [`666b6fa`](666b6fa), [`f3543d3`](f3543d3), [`f2060a6`](f2060a6), [`1562d35`](1562d35), [`7d8dcef`](7d8dcef), [`476658b`](476658b), [`70f4e91`](70f4e91)]: - @browserbasehq/[email protected] - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies [[`34edfa3`](34edfa3), [`a837acf`](a837acf), [`4da1a21`](4da1a21), [`5802f59`](5802f59), [`819db28`](819db28), [`0210688`](0210688), [`666b6fa`](666b6fa), [`f3543d3`](f3543d3), [`f2060a6`](f2060a6), [`1562d35`](1562d35), [`7d8dcef`](7d8dcef), [`476658b`](476658b), [`70f4e91`](70f4e91)]: - @browserbasehq/[email protected] - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies [[`34edfa3`](34edfa3), [`a837acf`](a837acf), [`4da1a21`](4da1a21), [`5802f59`](5802f59), [`819db28`](819db28), [`0210688`](0210688), [`666b6fa`](666b6fa), [`f3543d3`](f3543d3), [`f2060a6`](f2060a6), [`1562d35`](1562d35), [`7d8dcef`](7d8dcef), [`476658b`](476658b), [`70f4e91`](70f4e91)]: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies [[`34edfa3`](34edfa3), [`a837acf`](a837acf), [`4da1a21`](4da1a21), [`5802f59`](5802f59), [`819db28`](819db28), [`0210688`](0210688), [`666b6fa`](666b6fa), [`f3543d3`](f3543d3), [`f2060a6`](f2060a6), [`1562d35`](1562d35), [`7d8dcef`](7d8dcef), [`476658b`](476658b), [`70f4e91`](70f4e91)]: - @browserbasehq/[email protected] - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies [[`34edfa3`](34edfa3), [`a837acf`](a837acf), [`4da1a21`](4da1a21), [`5802f59`](5802f59), [`819db28`](819db28), [`0210688`](0210688), [`666b6fa`](666b6fa), [`f3543d3`](f3543d3), [`f2060a6`](f2060a6), [`1562d35`](1562d35), [`7d8dcef`](7d8dcef), [`476658b`](476658b), [`70f4e91`](70f4e91)]: - @browserbasehq/[email protected] - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies []: - @browserbasehq/[email protected] --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Miguel <[email protected]>
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.
Makes browser ownership explicit across the eval mount, facade process, and SDK. The tool-owned Browserbase lease stays alive across transport loss and is explicitly released on cleanup; a newly created session is also released when initial CDP attachment fails. Existing-session attachment retains caller ownership. Shared extension uploads retry explicit rate-limit rejections, avoid replaying ambiguous creates, and release their lease if bridge startup fails.
Closes the owned browser after a completed batch requests browser.close(), confines screenshot artifacts to the owned directory, and separates runner-only session metadata from the agent relay. Terminal loss is established by host telemetry, never by an agent-written error prefix. Validates provider settings before acquiring resources and keeps explicit environment inputs isolated.
Exposes typed tool invocation, browser-loss and evidence contracts for later adapters. The legacy prompt is available through direct stdio here; harness selection is added in the later adapter PRs. The inherited shutdown window before initialization returns a session handle remains documented; this change does not introduce a cancellation API.
Validation: 344 runtime/SDK tests and 60 focused eval tests, SDK/core/eval typechecks, core build, formatting, and built stdio dispatch coverage.
Stack position: 2/11 in the current review scope through #2901. Base:
evals/consolidation-01-hardbench. Each PR contains the change relative to its immediate predecessor.Reviewer entry points:
packages/integrations/core/src/facade/runtime.tspackages/evals/core/tools/stagehandFacadeBridge.tspackages/sdk-ts/src/browser/factories.tsCLI startup validation: general help now defers harness/tool registry imports, and CLI test subprocesses have bounded cleanup with a consistent cold-start deadline. This fixes the cold-help CI failure at this layer. The 66 CLI/help tests and eval typecheck pass locally; fresh full GitHub CI passed on this head.
Readiness: CI passed on
0679a58b1f. Review threads are triaged and resolved.