Conversation
|
This was referenced Aug 27, 2026
shrey150
force-pushed
the
agent/browse-v4-6-release
branch
from
August 28, 2026 02:52
503061a to
5ec53cb
Compare
This was referenced Aug 28, 2026
shrey150
force-pushed
the
agent/browse-v4-6-release
branch
from
September 11, 2026 17:49
b3a3b41 to
1dd7d0c
Compare
shrey150
force-pushed
the
agent/browse-v4-6-release
branch
from
September 11, 2026 18:23
1dd7d0c to
f8e2579
Compare
shrey150
force-pushed
the
agent/browse-v4-6-release
branch
from
September 11, 2026 20:18
f8e2579 to
f13b62d
Compare
shrey150
force-pushed
the
agent/browse-v4-6-release
branch
from
September 15, 2026 23:10
f13b62d to
1cef69e
Compare
shrey150
added a commit
that referenced
this pull request
Sep 15, 2026
## Summary Import `packages/cli/**` exactly from the published `browse@0.9.6` V3 release, without changing its source or runtime behavior. This is intentionally a provenance checkpoint, not a line-by-line feature review. The imported source is kept runnable by a root, version-scoped pnpm override that resolves its unchanged Stagehand dependency to `3.7.1`. #2834 removes that override and starts the V4 migration. ## Exact-source provenance - Annotated tag: `browse@0.9.6` (`548c56407431db27823a212f53475443c7e8358d`) - Release commit: `1d49a95c0c230c346f8d50647e10303d6310fcd2` - Authoritative CLI tree: `b4048badce921cf54f199f96033d9a014ef977ec` - This PR's `HEAD:packages/cli` tree: `b4048badce921cf54f199f96033d9a014ef977ec` The tag's ignored README whitespace is retained too; formatting the import would invalidate the tree proof. ## Verification - Current remote head: `a77e1507b85e3c02553f36ead6ebd0237b0cccc6`, based on current `main`. - `HEAD:packages/cli` exactly equals the published V3 tree hash above. - pnpm 11 frozen install and the repository supply-chain release-age policy pass. - Browse lint, typecheck, and build pass; the full baseline suite passes: 25 files / 366 tests. - A fresh extension build still exactly matches the Go-embedded archive: SHA-256 `8efc7d171a625cca95c02d02d369b59435fae776cae6c7dd2f6fe72eb19785c0` on both files. This specifically verifies that adding the V3 dependency graph does not perturb the current V4 extension artifact. - This layer intentionally exercises V3 through the scoped Stagehand 3.7.1 override. V4 behavior starts in #2834. ## Stack (#2872) 1. **#2833 — exact Browse V3 baseline import** 2. #2834 — Stagehand V4 runtime and standard command parity 3. #2869 — CLI-owned cursor overlay 4. #2849 — CLI-private CDP sidecar; V3 network parity 5. #2835 — remove `--return-xpath`; supported V3 parity/release checkpoint 6. #2838 — eval and packaging integration 7. #2839 — managed Context names (fast-follow) 8. #2701 — shared Functions core consumer (fast-follow) ## Review and landing boundary Review this PR by verifying the tree hashes, dependency pin, root package wiring, and changeset—not by treating the imported V3 source as newly authored code. This head deliberately imports V3 code into the V4 repository and is not independently publishable. It lands only as the base of the complete stack. The framework network-event schema proposal in #2832 is intentionally outside this landing stack.
shrey150
force-pushed
the
agent/browse-v4-6-release
branch
from
September 15, 2026 23:31
1cef69e to
25220d1
Compare
shrey150
added a commit
that referenced
this pull request
Sep 16, 2026
…2834) ## Summary Migrate Browse's browser lifecycle and standard command surface together from Stagehand V3 to V4. - Replace the V3 constructor/init lifecycle with V4 browser factories and `Stagehand.create()`. - Support managed local, Browserbase remote, and attached CDP connection targets. - Preserve owned-versus-attached cleanup, daemon persistence, Browserbase session identity, and timeout handling. - Restore navigation, page information, deterministic locator actions, keyboard/mouse input, viewport/screenshot, snapshot, eval, and tab commands on V4 APIs. - Keep click/fill/select deterministic; this does not add a model-free structured `act()` path. - Make the remaining cursor, network, and coordinate-XPath gaps fail explicitly for the stack layers that restore or remove them. ## Stack (#2872) 1. #2833 — exact Browse V3 baseline import 2. **#2834 — Stagehand V4 runtime and standard command parity** 3. #2869 — CLI-owned cursor overlay 4. #2849 — CLI-private CDP sidecar; V3 network parity 5. #2835 — remove `--return-xpath`; supported V3 parity/release checkpoint 6. #2838 — eval and packaging integration 7. #2839 — managed Context names (fast-follow) 8. #2701 — shared Functions core consumer (fast-follow) ## Review shape The lifecycle and command migration remain two ordered implementation commits: 1. `389e2dae6` — V4 browser/session foundation and lifecycle ownership. 2. `b45167462` — standard command translation on that foundation. They are one PR because both commits rewrite the same nine command/test files. Reviewing their combined final diff avoids temporary deletion/stubbing followed by reimplementation, while the commits still provide useful lifecycle-versus-command checkpoints. Review follow-up `24178275f` adds narrowly scoped ownership, error-sanitization, and timeout guards. The resulting PR diff is 23 files, +988/−436. Cursor DOM injection and private CDP network transport remain separate because they are independently reviewable mechanisms and cleanly additive diffs. The legacy coordinate `returnXPath` request is still accepted here but fails explicitly until #2835 removes the option. This remains an intentionally non-publishable intermediate head. ## E2E Test Matrix Fresh post-flatten verification used the actual built CLI at final head `6f7e9c209`. Every daemon command used an isolated owner-only runtime directory. | Command / flow | Observed output | Confidence / sufficiency | | --- | --- | --- | | `pnpm install --frozen-lockfile` | Lockfile passed supply-chain policy, was already up to date, and installation completed | Proves the flattened stack resolves exactly from the committed lockfile | | `pnpm exec turbo run build --filter=browse` | Protocol, extension, Stagehand SDK, and Browse CLI built successfully (4/4 tasks) | Proves the CLI was tested against this head's protocol/extension/SDK artifacts, not stale workspace `dist` files | | Compare the rebuilt extension with `packages/sdk-go/internal/extensionassets/stagehand-extension.zip` | Exact byte match; both SHA-256 `8efc7d171a625cca95c02d02d369b59435fae776cae6c7dd2f6fe72eb19785c0`; archive manifest and package version both `1.0.2` | Confirms the TypeScript/CLI build and Go-embedded extension are synchronized | | Built CLI: `browse open <synthetic-data-url> --remote`; `browse status` | Remote browser connected and initialized; deterministic fixture loaded | Exercises production Browserbase provisioning plus the V4 daemon/session lifecycle on the exact final head | | `browse get text //h1`; `fill`; `select`; `click`; `is checked`; `wait selector`; `highlight`; `viewport`; `screenshot`; `snapshot --full` | XPath returned `Ready`; input became `Ada`; select became `b`; click produced `Clicked`; checkbox was true; PNG was 17,761 bytes; snapshot contained the fixture | Covers deterministic V4 reads, actions, waits, state, and rendering without an LLM | | Set a page marker; `tab new`; `tab list`; `tab close`; read the marker from a new CLI process | Tab count changed to 2 and the original page returned marker `yes` | Proves daemon persistence, active-tab handling, and state reuse across invocations | | Inspect the isolated runtime directory/PID; `browse stop`; poll the Browserbase session | Modes were `0700` / `0600`; the owned remote session reached `COMPLETED` | Proves owner-only daemon files and owned Browserbase resource cleanup | | `browse cursor`; `browse network on`; `browse mouse hover ... --return-xpath` | Each exited 1 with the intended explicit layer-boundary error | Confirms this intermediate layer fails honestly until the cursor, network, and flag-removal layers land | | `pnpm --filter browse test` | 25 files / 385 tests passed | Full Browse unit/integration suite on the exact final head | The runner has no Chrome/Chromium installation, so a fresh attached-CDP ownership smoke was not possible. Attached-browser non-ownership remains covered by the focused suite and is not claimed as a fresh live result here.
Pin eval agents to the V4 workspace CLI, isolate per-run sessions, restrict the wrapper to driver commands, and guarantee cleanup on abort and process shutdown.
shrey150
force-pushed
the
agent/browse-v4-6-release
branch
from
September 16, 2026 00:23
25220d1 to
d57f6ff
Compare
shrey150
added a commit
that referenced
this pull request
Sep 17, 2026
## Summary
Restore Browse's visible cursor as a CLI-owned DOM overlay, without
adding a cursor API to core Stagehand V4.
- Keep the overlay implementation in one dedicated `cursor-overlay.ts`
file.
- Install it idempotently for the current document through
`page.evaluate(CURSOR_OVERLAY_SCRIPT)` and for future navigations
through `page.addInitScript(...)`.
- Retry installation on `DOMContentLoaded` when the init script runs
before the document root exists.
- Keep injection in the top frame and update the marker from coordinate
input, including when input lands inside a child frame.
- Treat visual position updates as best-effort so they cannot block or
invalidate real mouse input.
- Preserve the V3 `browse cursor` JSON response: `{ "cursor": "enabled"
}`.
## Stack (#2872)
1. #2833 — exact Browse V3 baseline import
2. #2834 — Stagehand V4 runtime and standard command parity
3. **#2869 — CLI-owned cursor overlay**
4. #2849 — CLI-private CDP sidecar; V3 network parity
5. #2835 — remove `--return-xpath`; supported V3 parity/release
checkpoint
6. #2838 — eval and packaging integration
7. #2839 — managed Context names (fast-follow)
8. #2701 — shared Functions core consumer (fast-follow)
## Why this is separate
The cursor is a self-contained optional visual feature with different
review concerns from the combined V4 runtime/command migration: injected
DOM/CSS, idempotency, event handling, and screenshot behavior. Keeping
it additive on #2834 lets this feature be reviewed or reverted without
disturbing browser lifecycle or commands.
## E2E Test Matrix
Review-feedback verification compared the exact prior head `6a9d6aa09`
with fixed implementation head `1035fbbf5` through the built CLI and
real Browserbase browsers. Final head `68f6fcb2c` only expands automated
coverage and does not change runtime code. Targets were the public
`example.com` and `example.org` pages.
| Command / flow | Observed output | Confidence / sufficiency |
| --- | --- | --- |
| Prior head: enable cursor, alternate 20 cross-origin navigations,
inspect `#__browse_cursor_overlay__` before any mouse input | Overlay
count was `0` after 20/20 navigations | Reproduces the DOM-readiness bug
raised in review |
| Fixed head: repeat the same 20-navigation flow | Overlay count was `1`
after 20/20 navigations (0 misses) | Proves the `DOMContentLoaded` retry
restores the overlay after navigation in the real browser path |
| Prior head: replace the page's cursor-position callback with a
throwing function, then run `browse mouse click 200 200` against an
oversized synthetic button | Command exited `1`; the page's click state
remained `null` | Reproduces the visual-update failure blocking real
mouse input |
| Fixed head: repeat the same forced overlay failure and click | CLI
returned `{ "clicked": true }`; page click state became `"yes"` | Proves
overlay rendering is best-effort while real input still executes |
| Built CLI: `browse cursor` | `{ "cursor": "enabled" }` (prior head
returned `{ "enabled": true }`) | Confirms V3-compatible output for
existing scripts |
| `pnpm --filter browse lint` | Passed formatting, ESLint, and
TypeScript checks | Static validation on the final head |
| `pnpm --filter browse test:cli` | 26 files / 393 tests passed | Full
Browse suite, including DOM readiness, safe styling, idempotency,
top-frame isolation, cursor positioning/clamping, and all four
coordinate input commands |
| `browse stop` after each live run | Completed successfully | Covers
Browserbase session and daemon cleanup |
The already-uploaded screenshot below remains representative visual
proof of the same overlay behavior.

No LLM path or customer data was involved.
This was referenced Sep 17, 2026
shrey150
added a commit
that referenced
this pull request
Sep 17, 2026
Release versioning rewrites evals' pinned Browse dependency without updating the lockfile, causing the next frozen install to fail ([failed release](https://github.com/browserbase/stagehand/actions/runs/35200720996/job/105134544106)). Use `browse: "workspace:*"`, update its lockfile importer, and make metadata tests read the workspace CLI version and entrypoint. The native Browse eval adapter also sends obsolete commands and fails at `--json` with both published Browse 0.9.5 and the workspace CLI. Update startup, tab/mouse commands, timeout and screenshot flags to the supported grammar. Track tabs by stable target IDs, follow the CLI-selected active tab after closing a page, and share short cryptographically random session names with the external wrapper. Regression tests cover tab identity, active-tab selection, malformed responses, and session-name safety/uniqueness. This PR targets `main` and includes the dependency/build changes from #2965 together with the adapter fixes. #2965 is superseded. Changesets policy and public-package versions are unchanged; broader wrapper restrictions and abort/cleanup-timeout work from #2838 remain outside this PR. ## E2E Test Matrix Current head `2ea510e1b` has the same code, dependencies, lockfile, and tests as verified commit `09f3feb7c`; only the upstream README was updated afterward. Retargeting this PR to `main` did not change its head commit. Both the dependency-only subset and the combined implementation were tested independently with pnpm 11.10.0. | Command / flow | Observed output | Confidence / sufficiency | | --- | --- | --- | | `CI=true pnpm install --frozen-lockfile` | Passed for dependency-only and combined changes | Confirms workspace dependency resolution and lockfile consistency | | `CI=true pnpm exec changeset version`, `CI=true pnpm exec tsx scripts/release/consolidate-changelogs.ts`, then `CI=true pnpm install --frozen-lockfile` | Passed for both; Browse became 0.9.7; eval manifest and lockfile stayed unchanged | Exercises the failing release sequence; generated release files were restored afterward | | `pnpm exec turbo run build --filter=@browserbasehq/stagehand-evals` | 14/14 build tasks passed for both | Builds Browse and eval bundles | | `pnpm exec vitest run --config packages/evals/vitest.config.ts --maxWorkers=4` | Combined: 92 files / 768 tests passed. Dependency-only subset: 90 files / 761 tests passed | Full eval unit suites, with the inherited devbox OpenAI key unset | | Actual native adapter against local Chromium | Startup, navigation, waits, fill/hover/coordinate click, press/typing, PNG/JPEG screenshots, snapshot and scrolling passed | Real CLI subprocesses against a synthetic local page | | Create/switch/close real browser tabs | Closing active middle, inactive and active last tabs preserved the CLI-selected page and subsequent titles | Verifies tab identity and active-page synchronization | | Actual generated Claude/Codex Browse wrapper | Opened and submitted a synthetic form and read the expected title; passed for both subsets | Shared external wrapper works with the workspace CLI | | Native/wrapper cleanup | No remaining PID/socket files after shutdown settled | Smoke resources cleaned up | | GitHub CI after the README reconciliation | Dependency-only parent: 46 passed, 9 skipped. Combined head while stacked: 9 passed, 15 skipped; none failed or pending | The earlier combined source tree also passed the full 47-check CI run; check selection depends on the PR diff | The native adapter's obsolete-command failure predates the dependency switch; the build fix itself does not require the adapter changes. Browser smokes used local Chromium with an isolated daemon directory and a test-only `--no-sandbox` launcher for the container. Remote adapter sessions, paid model evals, and package publishing were not performed locally.
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
Make workspace evals and packaging consume the V4 Browse CLI proven in #2835.
The Browse migration changeset now belongs to #2835, the first complete supported-parity head; this PR has no changeset in its own diff. The unrelated eval CLI
--verbosechanges from the old draft are intentionally excluded.Stack (#2872)
--return-xpath; supported V3 parity/release checkpointReview boundary
This is a consumer/integration layer, not another runtime-parity layer. Its diff is limited to eval adapters, their tests, workspace dependency wiring, and the lockfile.
E2E Test Matrix
The current remote PR head is
f13b62d4c17afc55673b82a34ea03622e6eec570. The complete matrix below ran atf8e2579571b5c059753881f14b80abb718066a94; the only inherited change since then is #2849's test-helper timeout diagnostic, whose focused network tests and Browse lint/typecheck passed at sidecar head9887732b6. The product diff is unchanged from proof commit1dd7d0c8ef7ac65697f91780620a417a8ceb6bdd, where the packed-consumer and browser-backed wrapper flows below ran. Browser-backed runs used an isolated daemon directory; the pre-existing default daemon was not touched.f8e257957:pnpm install --frozen-lockfile; buildbrowse; build@browserbasehq/stagehand-evalsf8e257957: full@browserbasehq/stagehand-evalstest suite1dd7d0c8:pnpm --filter browse pack; install the tarball in an empty npm consumer; runnode_modules/.bin/browse --versionandbrowse open --helpworkspace:*to Stagehand4.1.0; installed binary reportedbrowse/0.9.6; V4--remoteand--cdpflags were present.1dd7d0c8: built ESMprepareBrowseCliHarnessAdaptertwicepackages/cli/bin/run.jsat version0.9.6; generated sessions and workdirs were distinct.1dd7d0c8: execute the generated pinned wrapper as a real subprocess:browse open https://example.com, thenbrowse get titleExample Domain.1dd7d0c8: invokebrowse cloud contexts listthrough that wrapper1dd7d0c8: register both live adapter cleanups; cooperative abort; aggressive abort@browserbasehq/stagehand-evalsis private and is intentionally tested as a built workspace consumer, while the publicbrowsepackage is additionally tested as an isolated packed consumer.