Repository navigation
[fix]: rm legacy handlePossibleNavigation() - #1761
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 1d2c3d6 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 |
Contributor
Greptile SummaryRemoves the legacy
Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 1d2c3d6 |
victlue
approved these changes
Feb 26, 2026
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 Handler as Action Handler
participant Frame as Browser Frame
participant Logger as v3Logger
Note over Handler, Frame: performUnderstudyMethod()
Handler->>Frame: Execute Browser Action (e.g. click)
alt Action triggers Page/Frame Closure
Frame-->>Handler: Success (Frame detached)
Note over Handler: CHANGED: No longer calls Frame.url() <br/> avoiding 'Frame detached' error logs
else Happy Path
Frame-->>Handler: Success (Frame exists)
end
opt Execution Error
Handler->>Logger: Log error & stack trace
end
Handler-->>Handler: Return result/error status
This was referenced Feb 25, 2026
Merged
This was referenced Mar 10, 2026
miguelg719
pushed a commit
that referenced
this pull request
Mar 18, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @browserbasehq/[email protected] ### Minor Changes - [#1816](#1816) [`687d54a`](687d54a) Thanks [@shrey150](https://github.com/shrey150)! - Add `--context-id` and `--persist` flags to `browse open` for loading and persisting Browserbase Contexts across sessions - [#1793](#1793) [`e38c13b`](e38c13b) Thanks [@shrey150](https://github.com/shrey150)! - Initial release of browse CLI - browser automation for AI agents ### Patch Changes - [#1806](#1806) [`f8c7738`](f8c7738) Thanks [@shrey150](https://github.com/shrey150)! - Fix `browse env` showing stale mode after `browse env remote` - Updated dependencies \[[`505e8c6`](505e8c6), [`2f43ffa`](2f43ffa), [`63ee247`](63ee247), [`7dc35f5`](7dc35f5), [`335cf47`](335cf47), [`6ba0a1d`](6ba0a1d), [`4ff3bb8`](4ff3bb8), [`c27054b`](c27054b), [`2abf5b9`](2abf5b9), [`7817fcc`](7817fcc), [`7390508`](7390508), [`611f43a`](611f43a), [`521a10e`](521a10e), [`2402a3c`](2402a3c)]: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Minor Changes - [#1779](#1779) [`2f43ffa`](2f43ffa) Thanks [@shrey150](https://github.com/shrey150)! - feat: add `cdpHeaders` option to `localBrowserLaunchOptions` for passing custom HTTP headers when connecting to an existing browser via CDP URL - [#1834](#1834) [`63ee247`](63ee247) Thanks [@tkattkat](https://github.com/tkattkat)! - Update stagehand agents search tool - [#1774](#1774) [`521a10e`](521a10e) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - add new page.setExtraHTTPHeaders() method ### Patch Changes - [#1759](#1759) [`505e8c6`](505e8c6) Thanks [@shrey150](https://github.com/shrey150)! - Add bedrock to the provider enum in model configuration schemas and regenerate OpenAPI spec. - [#1814](#1814) [`7dc35f5`](7dc35f5) Thanks [@tkattkat](https://github.com/tkattkat)! - Change usage of openai provider in agent to default to store:false - [#1846](#1846) [`335cf47`](335cf47) Thanks [@aq17](https://github.com/aq17)! - Fix streaming finished event being silently dropped. The final SSE event containing the result payload (success status, message, actions, usage, and messages) was previously discarded instead of being yielded to the caller. - [#1764](#1764) [`6ba0a1d`](6ba0a1d) Thanks [@shrey150](https://github.com/shrey150)! - Expose `headers` in `GoogleVertexProviderSettings` so model configs can pass custom provider headers (for example `X-Goog-Priority`) without TypeScript errors. - [#1847](#1847) [`4ff3bb8`](4ff3bb8) Thanks [@miguelg719](https://github.com/miguelg719)! - Enable FlowLogger on BROWSERBASE_FLOW_LOGS=1 - [#1752](#1752) [`c27054b`](c27054b) Thanks [@derekmeegan](https://github.com/derekmeegan)! - fix: pause Browserbase agents while captcha solving is active and improve CUA recovery after the solve completes - [#1800](#1800) [`2abf5b9`](2abf5b9) Thanks [@shrey150](https://github.com/shrey150)! - Make projectId optional for Browserbase sessions — only BROWSERBASE_API_KEY is required - [#1766](#1766) [`7817fcc`](7817fcc) Thanks [@tkattkat](https://github.com/tkattkat)! - Add configurable timeout to tools in agent - [#1749](#1749) [`7390508`](7390508) Thanks [@pirate](https://github.com/pirate)! - When connecting to a browser session that has zero open tabs, Stagehand now automatically creates an initial `about:blank` tab so the connection can continue. - [#1761](#1761) [`611f43a`](611f43a) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - fix issue where handlePossibleNavigation was producing unnecessary error logs on clicks that trigger page close - [#1817](#1817) [`2402a3c`](2402a3c) Thanks [@tkattkat](https://github.com/tkattkat)! - Add support for passing custom headers in clientOptions ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies \[[`505e8c6`](505e8c6), [`2f43ffa`](2f43ffa), [`63ee247`](63ee247), [`7dc35f5`](7dc35f5), [`335cf47`](335cf47), [`6ba0a1d`](6ba0a1d), [`4ff3bb8`](4ff3bb8), [`c27054b`](c27054b), [`2abf5b9`](2abf5b9), [`7817fcc`](7817fcc), [`7390508`](7390508), [`611f43a`](611f43a), [`521a10e`](521a10e), [`2402a3c`](2402a3c)]: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - [#1759](#1759) [`505e8c6`](505e8c6) Thanks [@shrey150](https://github.com/shrey150)! - Add bedrock to the provider enum in model configuration schemas and regenerate OpenAPI spec. - Updated dependencies \[[`505e8c6`](505e8c6), [`2f43ffa`](2f43ffa), [`63ee247`](63ee247), [`7dc35f5`](7dc35f5), [`335cf47`](335cf47), [`6ba0a1d`](6ba0a1d), [`4ff3bb8`](4ff3bb8), [`c27054b`](c27054b), [`2abf5b9`](2abf5b9), [`7817fcc`](7817fcc), [`7390508`](7390508), [`611f43a`](611f43a), [`521a10e`](521a10e), [`2402a3c`](2402a3c)]: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies \[[`505e8c6`](505e8c6), [`2f43ffa`](2f43ffa), [`63ee247`](63ee247), [`7dc35f5`](7dc35f5), [`335cf47`](335cf47), [`6ba0a1d`](6ba0a1d), [`4ff3bb8`](4ff3bb8), [`c27054b`](c27054b), [`2abf5b9`](2abf5b9), [`7817fcc`](7817fcc), [`7390508`](7390508), [`611f43a`](611f43a), [`521a10e`](521a10e), [`2402a3c`](2402a3c)]: - @browserbasehq/[email protected] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
felipeofdev-ai
pushed a commit
to felipeofdev-ai/stagehand
that referenced
this pull request
Aug 4, 2026
# why - this function was from legacy stagehand which only operated on one page - presently, it was only being used to produce a log which: - at best, misinformed users on whether the page had actually navigated, and, - at worst, resulted in a noisy error log - the error log would happen if `clickElement()` triggered page closure. this means that the frame.evaluate() to get the URL would attempt `.evaluate()` on a frame that no longer existed # what changed - removed `handlePossibleNavigation()` # test plan - existing tests are fine here <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Removed the legacy handlePossibleNavigation() that tried to detect navigation by URL and produced misleading logs. This also prevents errors when clicks close the page and evaluate runs on a non-existent frame, reducing log noise. <sup>Written for commit 1d2c3d6. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/1761">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. -->
felipeofdev-ai
pushed a commit
to felipeofdev-ai/stagehand
that referenced
this pull request
Aug 4, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @browserbasehq/[email protected] ### Minor Changes - [browserbase#1816](browserbase#1816) [`687d54a`](browserbase@687d54a) Thanks [@shrey150](https://github.com/shrey150)! - Add `--context-id` and `--persist` flags to `browse open` for loading and persisting Browserbase Contexts across sessions - [browserbase#1793](browserbase#1793) [`e38c13b`](browserbase@e38c13b) Thanks [@shrey150](https://github.com/shrey150)! - Initial release of browse CLI - browser automation for AI agents ### Patch Changes - [browserbase#1806](browserbase#1806) [`f8c7738`](browserbase@f8c7738) Thanks [@shrey150](https://github.com/shrey150)! - Fix `browse env` showing stale mode after `browse env remote` - Updated dependencies \[[`505e8c6`](browserbase@505e8c6), [`2f43ffa`](browserbase@2f43ffa), [`63ee247`](browserbase@63ee247), [`7dc35f5`](browserbase@7dc35f5), [`335cf47`](browserbase@335cf47), [`6ba0a1d`](browserbase@6ba0a1d), [`4ff3bb8`](browserbase@4ff3bb8), [`c27054b`](browserbase@c27054b), [`2abf5b9`](browserbase@2abf5b9), [`7817fcc`](browserbase@7817fcc), [`7390508`](browserbase@7390508), [`611f43a`](browserbase@611f43a), [`521a10e`](browserbase@521a10e), [`2402a3c`](browserbase@2402a3c)]: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Minor Changes - [browserbase#1779](browserbase#1779) [`2f43ffa`](browserbase@2f43ffa) Thanks [@shrey150](https://github.com/shrey150)! - feat: add `cdpHeaders` option to `localBrowserLaunchOptions` for passing custom HTTP headers when connecting to an existing browser via CDP URL - [browserbase#1834](browserbase#1834) [`63ee247`](browserbase@63ee247) Thanks [@tkattkat](https://github.com/tkattkat)! - Update stagehand agents search tool - [browserbase#1774](browserbase#1774) [`521a10e`](browserbase@521a10e) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - add new page.setExtraHTTPHeaders() method ### Patch Changes - [browserbase#1759](browserbase#1759) [`505e8c6`](browserbase@505e8c6) Thanks [@shrey150](https://github.com/shrey150)! - Add bedrock to the provider enum in model configuration schemas and regenerate OpenAPI spec. - [browserbase#1814](browserbase#1814) [`7dc35f5`](browserbase@7dc35f5) Thanks [@tkattkat](https://github.com/tkattkat)! - Change usage of openai provider in agent to default to store:false - [browserbase#1846](browserbase#1846) [`335cf47`](browserbase@335cf47) Thanks [@aq17](https://github.com/aq17)! - Fix streaming finished event being silently dropped. The final SSE event containing the result payload (success status, message, actions, usage, and messages) was previously discarded instead of being yielded to the caller. - [browserbase#1764](browserbase#1764) [`6ba0a1d`](browserbase@6ba0a1d) Thanks [@shrey150](https://github.com/shrey150)! - Expose `headers` in `GoogleVertexProviderSettings` so model configs can pass custom provider headers (for example `X-Goog-Priority`) without TypeScript errors. - [browserbase#1847](browserbase#1847) [`4ff3bb8`](browserbase@4ff3bb8) Thanks [@miguelg719](https://github.com/miguelg719)! - Enable FlowLogger on BROWSERBASE_FLOW_LOGS=1 - [browserbase#1752](browserbase#1752) [`c27054b`](browserbase@c27054b) Thanks [@derekmeegan](https://github.com/derekmeegan)! - fix: pause Browserbase agents while captcha solving is active and improve CUA recovery after the solve completes - [browserbase#1800](browserbase#1800) [`2abf5b9`](browserbase@2abf5b9) Thanks [@shrey150](https://github.com/shrey150)! - Make projectId optional for Browserbase sessions — only BROWSERBASE_API_KEY is required - [browserbase#1766](browserbase#1766) [`7817fcc`](browserbase@7817fcc) Thanks [@tkattkat](https://github.com/tkattkat)! - Add configurable timeout to tools in agent - [browserbase#1749](browserbase#1749) [`7390508`](browserbase@7390508) Thanks [@pirate](https://github.com/pirate)! - When connecting to a browser session that has zero open tabs, Stagehand now automatically creates an initial `about:blank` tab so the connection can continue. - [browserbase#1761](browserbase#1761) [`611f43a`](browserbase@611f43a) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - fix issue where handlePossibleNavigation was producing unnecessary error logs on clicks that trigger page close - [browserbase#1817](browserbase#1817) [`2402a3c`](browserbase@2402a3c) Thanks [@tkattkat](https://github.com/tkattkat)! - Add support for passing custom headers in clientOptions ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies \[[`505e8c6`](browserbase@505e8c6), [`2f43ffa`](browserbase@2f43ffa), [`63ee247`](browserbase@63ee247), [`7dc35f5`](browserbase@7dc35f5), [`335cf47`](browserbase@335cf47), [`6ba0a1d`](browserbase@6ba0a1d), [`4ff3bb8`](browserbase@4ff3bb8), [`c27054b`](browserbase@c27054b), [`2abf5b9`](browserbase@2abf5b9), [`7817fcc`](browserbase@7817fcc), [`7390508`](browserbase@7390508), [`611f43a`](browserbase@611f43a), [`521a10e`](browserbase@521a10e), [`2402a3c`](browserbase@2402a3c)]: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - [browserbase#1759](browserbase#1759) [`505e8c6`](browserbase@505e8c6) Thanks [@shrey150](https://github.com/shrey150)! - Add bedrock to the provider enum in model configuration schemas and regenerate OpenAPI spec. - Updated dependencies \[[`505e8c6`](browserbase@505e8c6), [`2f43ffa`](browserbase@2f43ffa), [`63ee247`](browserbase@63ee247), [`7dc35f5`](browserbase@7dc35f5), [`335cf47`](browserbase@335cf47), [`6ba0a1d`](browserbase@6ba0a1d), [`4ff3bb8`](browserbase@4ff3bb8), [`c27054b`](browserbase@c27054b), [`2abf5b9`](browserbase@2abf5b9), [`7817fcc`](browserbase@7817fcc), [`7390508`](browserbase@7390508), [`611f43a`](browserbase@611f43a), [`521a10e`](browserbase@521a10e), [`2402a3c`](browserbase@2402a3c)]: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies \[[`505e8c6`](browserbase@505e8c6), [`2f43ffa`](browserbase@2f43ffa), [`63ee247`](browserbase@63ee247), [`7dc35f5`](browserbase@7dc35f5), [`335cf47`](browserbase@335cf47), [`6ba0a1d`](browserbase@6ba0a1d), [`4ff3bb8`](browserbase@4ff3bb8), [`c27054b`](browserbase@c27054b), [`2abf5b9`](browserbase@2abf5b9), [`7817fcc`](browserbase@7817fcc), [`7390508`](browserbase@7390508), [`611f43a`](browserbase@611f43a), [`521a10e`](browserbase@521a10e), [`2402a3c`](browserbase@2402a3c)]: - @browserbasehq/[email protected]
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
clickElement()triggered page closure. this means that the frame.evaluate() to get the URL would attempt.evaluate()on a frame that no longer existedwhat changed
handlePossibleNavigation()test plan
Summary by cubic
Removed the legacy handlePossibleNavigation() that tried to detect navigation by URL and produced misleading logs. This also prevents errors when clicks close the page and evaluate runs on a non-existent frame, reducing log noise.
Written for commit 1d2c3d6. Summary will update on new commits. Review in cubic