fix(cli): restore V3 network capture through a CDP sidecar - #2849
Draft
shrey150 wants to merge 25 commits into
Draft
fix(cli): restore V3 network capture through a CDP sidecar#2849shrey150 wants to merge 25 commits into
shrey150 wants to merge 25 commits into
Conversation
…runtime # Conflicts: # packages/cli/src/lib/driver/commands/elements.ts # packages/cli/src/lib/driver/commands/keyboard.ts # packages/cli/src/lib/driver/commands/mouse.ts # packages/cli/src/lib/driver/commands/navigation.ts # packages/cli/src/lib/driver/commands/page-info.ts # packages/cli/src/lib/driver/commands/runtime.ts # packages/cli/src/lib/driver/commands/tabs.ts # packages/cli/src/lib/driver/daemon/client.ts # packages/cli/src/lib/driver/network-capture.ts # packages/cli/src/lib/driver/remote-types.ts # packages/cli/src/lib/driver/remote.disabled.ts # packages/cli/src/lib/driver/remote.ts # packages/cli/src/lib/driver/session-manager.ts # packages/cli/tests/driver-commands.test.ts # packages/cli/tests/driver-foundation.test.ts # packages/cli/tests/identity-attribution.test.ts # packages/cli/tests/remote-disabled.test.ts # packages/cli/tests/remote-options.test.ts # pnpm-lock.yaml # turbo.json
…-sidecar # Conflicts: # packages/cli/src/lib/driver/network-capture.ts
…-sidecar # Conflicts: # packages/cli/src/lib/driver/network-capture.ts
|
This was referenced Aug 28, 2026
…4-network-sidecar # Conflicts: # packages/cli/src/lib/driver/network-capture.ts # packages/cli/tests/driver-commands.test.ts
shrey150
changed the base branch from
agent/browse-v4-4-runtime
to
agent/browse-v4-cli-cursor-overlay
August 31, 2026 21:41
This was referenced Aug 31, 2026
…4-network-sidecar
…4-network-sidecar
…om/browserbase/stagehand into agent/browse-v4-network-sidecar
…om/browserbase/stagehand into agent/browse-v4-network-sidecar
…4-network-sidecar
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
Restore Browse V3 network-capture behavior on Stagehand V4 through a CLI-private CDP sidecar, without committing core Stagehand, its protocol, or generated SDKs to a public network-event schema.
Stack (#2872)
--return-xpath; supported V3 parity/release checkpointArchitecture
on/off/sendsession shape.network off, remove listeners, sendNetwork.disable, and detach the page target.The request correlation and request/response JSON writer are inherited from the V3 CLI. No public protocol schema, extension, SDK, or generated-client changes are included. #2832 remains open outside the landing stack for that separate API-design discussion.
User-visible behavior
The V3 command and file surface is retained:
Each request directory contains
request.jsonand, when available,response.json, including the existing treatment of POST bodies, response bodies, failures, redirects, cache hits, and binary responses.Built V3 vs V4 differential
The actual built V3 CLI and this actual built V4 CLI were run as subprocesses against the same deterministic HTTP fixture at network implementation commit
5d39c89d7f. Current stack head61cc82f51additionally contains propagated upstream runtime and cursor review fixes; it does not change the sidecar implementation.on/path/off/path/clearreturn shape[]/redirect+ response for/final0700; files0600Normalization was limited to values that cannot match across independent browser runs: CDP request ID, timestamp, duration, HTTP
Date, and fixture origin/port. Header names/casing, methods, paths, bodies, statuses, MIME types, status text, error shape, counters, and file modes were compared as emitted.Real Browserbase lifecycle
The actual built CLI completed two
network on → navigate → offcycles in one Browserbase session. Each cycle captured a GET 200 and the full Example Domain response body with0700/0600permissions. The Browserbase session identity stayed stable, a subsequentopen --wait networkidlesucceeded, status remained connected/initialized/remote, andbrowse stopcompleted.Real-site stress E2E
The exact built V3 CLI (
7365a20d5) and exact built #2849 CLI (5d39c89d7f) each ran two bounded capture cycles in one real Browserbase session:network on → path → open → scroll → collect for 12s → off → path → navigate while off → status → clear. MSN and CNN were used as public, request-heavy targets.0700, files0600; navigation afteroffadded zero records;clearleft zero entries after both cycles.Live sites are nondeterministic, so request counts and exact request sets are reported rather than expected to match. Request-only records at the bounded
offpoint were 18/4 for V3 and 28/7 for V4 across MSN/CNN, reflecting in-flight or long-lived traffic; every emitted response parsed and matched its request ID. This matrix exercises high-concurrency HTTP traffic and cross-origin documents, but does not claim WebSocket-frame, SSE-message, service-worker, or every out-of-process-iframe edge-case coverage.5d39c89d7f,pnpm --filter browse lintpassed.5d39c89d7f,pnpm --filter browse testpassed: 27 files / 383 tests.