Repository navigation
feat(sdk-go): expose SessionID on Browserbase browser handles - #2674
Merged
Merged
Conversation
Go port of the TS change: nil-safe accessor over the worker session metadata already held by the handle; empty string for local browsers.
|
Contributor
There was a problem hiding this comment.
1 issue found across 1 file
Confidence score: 5/5
- In
packages/sdk-go/browser.go, the new exportedBrowser.SessionID()method is currently untested, so a future refactor could break the public accessor without being caught and downstream SDK consumers might get incorrect session IDs — add a focused unit test inbrowser_test.gothat assertsBrowser.SessionID()directly.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/sdk-go/browser.go">
<violation number="1" location="packages/sdk-go/browser.go:70">
P3: The new exported `Browser.SessionID()` accessor has no unit coverage. The existing `browser_test.go` only reads the internal `claimed.workerBrowser.SessionID` field, so the public method's behavior is unverified — particularly the `""` fallback for local browsers and the nil-browser/nil-`workerBrowser` safety branches. Adding a couple of focused tests (a Browserbase handle returning its session id, and a local browser returning `""`, plus a nil-receiver call) would encode the contract and prevent regressions in the cross-language parity surface.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
seanmcguire12
approved these changes
Aug 10, 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.
Go port of #2672 (TS contract) alongside the Python port #2673: nil-safe
SessionID()accessor onBrowser, sourced from the worker session metadata the handle already carries; empty string for local browsers.Gate: gofmt clean, go vet clean, package tests pass (examples build failure in
go test ./...is pre-existing on v4-spike;scripts/check-examples.shpasses).Summary by cubic
Added a nil-safe
SessionID()method to the Go SDKBrowserto get the Browserbase session ID. It returns an empty string for local browsers or when the handle is nil.Written for commit 72f3cb2. Summary will update on new commits.