Conversation
🦋 Changeset detectedLatest commit: 4a0c58d The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
filip-michalsky
approved these changes
Feb 1, 2026
pirate
reviewed
Feb 2, 2026
pirate
approved these changes
Feb 2, 2026
Contributor
Greptile OverviewGreptile SummaryAdded custom Changes:
The implementation is straightforward and follows the existing codebase patterns. The Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client as Stagehand Client
participant CDP as CdpConnection
participant WS as WebSocket (ws library)
participant Server as CDP Server
Client->>CDP: CdpConnection.connect(wsUrl)
CDP->>WS: new WebSocket(wsUrl, {headers})
Note over WS: Headers include:<br/>User-Agent: Stagehand/<version>
WS->>Server: WebSocket handshake<br/>with User-Agent header
Server-->>WS: Connection established
WS-->>CDP: 'open' event
CDP-->>Client: Return CdpConnection instance
Note over Server: Server can now identify<br/>Stagehand sessions via<br/>User-Agent for logging
|
Contributor
There was a problem hiding this comment.
No issues found across 2 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Architecture diagram
sequenceDiagram
participant App as Stagehand Core (CdpConnection)
participant WS as WebSocket Client (ws)
participant Server as CDP Server (e.g. Browserbase)
Note over App,Server: Establishing CDP Connection
App->>App: NEW: Retrieve STAGEHAND_VERSION
App->>WS: connect(wsUrl)
Note right of App: NEW: Set headers: { "User-Agent": "Stagehand/X.X.X" }
WS->>Server: CHANGED: HTTP Upgrade Request (with User-Agent)
alt Handshake Success
Server-->>WS: 101 Switching Protocols
WS-->>App: resolve()
else Handshake Failure
Server-->>WS: Error / Connection Refused
WS-->>App: reject(error)
end
Note over Server: Server logs User-Agent for observability/version tracking (NEW)
Clarifies that the custom User-Agent header enables server-side observability and version tracking for Stagehand CDP connections. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Added a code comment in CdpConnection.connect explaining that the custom User-Agent enables server-side observability and version tracking for Stagehand CDP connections. Aligns with STG-1262 by documenting the intent behind the header. <sup>Written for commit 2bf3748. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/1657">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. --> Co-authored-by: Chromie Bot <chromie@browserbase.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
seanmcguire12
approved these changes
Feb 4, 2026
This was referenced Feb 4, 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.
why
For observability into stagehand sessions
what changed
Stagehand/<version>user agent header to CDP connections.test plan
Summary by cubic
Set a custom User-Agent on CDP WebSocket connections: Stagehand/ using STAGEHAND_VERSION. This helps servers identify the client for logging and compatibility.
Written for commit 4a0c58d. Summary will update on new commits. Review in cubic