Repository navigation
fix: release child-frame references when pages close - #3129
Open
antonvishal wants to merge 4 commits into
Open
antonvishal wants to merge 4 commits into
antonvishal wants to merge 4 commits into
Conversation
🦋 Changeset detectedLatest commit: 62943a4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 24 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
|
This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run. |
antonvishal
marked this pull request as ready for review
October 7, 2026 16:45
…leanup # Conflicts: # packages/sdk-go/internal/extensionassets/stagehand-extension.zip
…erf-frame-cleanup # Conflicts: # packages/sdk-go/internal/extensionassets/stagehand-extension.zip
This branch has not been deployed
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
Closing 100 pages with nested frames left 200 stale child-frame owners. This fix leaves zero, confirmed in three runs of the cleanup fixture. Reused contexts no longer retain those disposed pages.
Medians of three local runs, each with 128 billing flows and four reused browsers. No LLM calls.
The billing flow measures general overhead; the nested-frame fixture measures the cleanup fix.
What
Clear ownership and frame caches for removed subtrees and dispose pages during context shutdown. Preserve process swaps. Finish cleanup even when disposal or connection close fails, while retaining the errors.
How
1,177 extension/TypeScript tests and four browser lifecycle tests passed. Coverage includes nested frames, OOPIF detach, process swaps and failed cleanup. Builds and extension typecheck passed.
Summary by cubic
Fixes stale frame ownership and cache entries after pages close. A 100-page nested-frame cleanup fixture retained 200 child-frame owners before and zero after, with the same result in three runs.
Written for commit 62943a4. Summary will update on new commits.