Remove Stagehand context accessors - #2585
Open
miguelg719 wants to merge 1 commit into
Open
Conversation
|
miguelg719
force-pushed
the
miguelgonzalez/stg-2763-remove-stagehandcontext
branch
from
August 4, 2026 19:27
c014ab0 to
e868799
Compare
Contributor
There was a problem hiding this comment.
cubic analysis
All reported issues were addressed
Linked issue analysis
Linked issue: STG-2763: Change stagehand.context to browser.context
| Status | Acceptance criteria | Notes |
|---|---|---|
| ✅ | Remove Stagehand.Context() method from the Go SDK API | The Stagehand.Context() method was deleted from packages/sdk-go/stagehand.go; related tests now reference the browser handle. |
| ✅ | Replace uses of Stagehand.Context() with Browser().Context() in Go tests/code | Live/test code now calls client.Browser().Context() and error messages updated accordingly. |
| ✅ | Add Go unit test asserting Stagehand does not expose Context | A test was added that fails if Stagehand has a Context method. |
| ✅ | Remove Stagehand.context property in Python and add a test ensuring it's not exposed | The context property was removed from the Python Stagehand class and a test asserts Stagehand has no 'context' attribute. |
| ✅ | Remove Stagehand.context getter in TypeScript and add tests asserting it is not published | The getter was removed and tests now assert 'context' is not present on Stagehand.prototype and via type checks. |
| ✅ | Update docs/README to indicate context is on the browser handle | README text was changed to state that Stagehand exposes context on the browser handle. |
| ✅ | Update cross-language parity expectations to no longer require Stagehand.Context | The parity rule no longer includes 'Context' in the Stagehand accessor set. |
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
miguelg719
force-pushed
the
miguelgonzalez/stg-2763-remove-stagehandcontext
branch
from
August 4, 2026 20:23
e868799 to
9c587da
Compare
miguelg719
force-pushed
the
miguelgonzalez/stg-2763-remove-stagehandcontext
branch
from
August 4, 2026 20:25
9c587da to
9781407
Compare
miguelg719
force-pushed
the
miguelgonzalez/stg-2763-remove-stagehandcontext
branch
from
August 4, 2026 21:59
9781407 to
c950fc7
Compare
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
With consumers migrated, keeping Stagehand context aliases would preserve an API we do not want to support in v4.
what changed
Removes Stagehand context accessors from TypeScript, Python, and Go and adds API regression guards plus updated parity expectations.
No changeset: this targets the unreleased v4 API.
test plan
Summary by cubic
Removed
Stagehandcontext accessors across TypeScript, Python, and Go. Onlystagehand.browser.contextremains, with new public API tests and parity rules to prevent reintroducing the legacy accessor.stagehand.contexttostagehand.browser.context.stagehand.contexttostagehand.browser.context.Stagehand.Context()toStagehand.Browser().Context().Linked Linear: STG-2763.
Written for commit c950fc7. Summary will update on new commits.