feat(stagehand): expose typed network capture events - #2832
Draft
shrey150 wants to merge 2 commits into
Draft
Conversation
🦋 Changeset detectedLatest commit: c0de0a1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 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 |
This was referenced Aug 27, 2026
shrey150
force-pushed
the
agent/browse-v4-2-network-capture
branch
from
August 28, 2026 02:52
bc25023 to
c0de0a1
Compare
shrey150
changed the base branch from
agent/browse-v4-1-cursor-overlay
to
main
August 28, 2026 03:00
This was referenced Aug 28, 2026
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
Expose a public, typed page-scoped network stream for Browse and other Stagehand V4 clients.
page.on("network", listener)emits request, completion, and failure events.Network.disable, because Stagehand navigation andnetworkidleshare that domain.Landing status
This public network-event API draft is intentionally not part of the Browse V4 landing stack. It remains open because it has already been shared for framework/API design review.
The Browse CLI restores its V3 network command through a CLI-private CDP sidecar in #2849, without depending on this PR or committing Stagehand to these schemas.
Landing stack: #2833 → #2834 → #2849 → #2835 → #2838 → #2839 → #2701
Review boundary
This is an independent core Stagehand API-design draft. No PR in the Browse V4 landing stack consumes it. The proposal extends the existing
NetworkManager; TypeScript exports a discriminatedPageNetworkEventunion, while Python and Go receive compatible generated additions. Review it on the merits of that long-lived public contract, not as migration plumbing.Usage proven by E2E
The following standalone Stagehand script was typechecked and rerun against real Chromium on the cursor-free rewritten head
c0de0a14c:E2E Test Matrix
NETWORK_STREAM_PASS; document titleNetwork E2EPOST /api/dataNetwork.requestWillBeSentand 3Network.loadingFinishedeventsPOST, path/api/data, body{"probe":"network-firehose"}200, MIMEapplication/json, body{"value":"network-body-ok"},base64Encoded: falsesubscription.unsubscribe(), then issue more trafficThe real-browser smoke covers a local main page. OOPIF collision handling, redirects/failures, and cross-language generation are covered by automated tests rather than a second live-browser fixture.