fix(eve): close facade browser resources - #2793
Open
shrey150 wants to merge 2 commits into
Open
Conversation
|
This was referenced Aug 20, 2026
shrey150
force-pushed
the
shrey/eve-facade-session-close-eve
branch
from
August 20, 2026 23:34
ac10ecc to
95e2c7e
Compare
shrey150
marked this pull request as ready for review
August 20, 2026 23:35
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
shrey150
force-pushed
the
shrey/eve-facade-session-close-eve
branch
from
August 21, 2026 00:15
95e2c7e to
09ac8fa
Compare
Signed-off-by: Shrey Pandya <shrey@browserbase.com>
Signed-off-by: Shrey Pandya <shrey@browserbase.com>
shrey150
force-pushed
the
shrey/eve-facade-session-close-eve
branch
from
August 21, 2026 00:25
0bc86f0 to
96be869
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
This is PR 2 of the facade-close stack and depends on #2788.
The shared facade now propagates
browser.close()to a host lifecycle callback, but Eve owns additional state that core cannot clean up generically: a keep-alive Browserbase session, its persisted session ID, reconnect/recovery decisions, and the currently cached facade tools. Eve must consume the signal at that ownership boundary.Before this change, model-authored
await browser.close()could return successfully while Eve retained the same facade and persisted Browserbase session. A later call could reuse authentication/cookie state from a browser the agent believed it had closed.what changed
Stagehand.create(); if local close fails, release is attempted immediately and persisted ownership is either cleared or retained for retry.BrowserbaseSessionReleaseError.behavior before and after
await browser.close()RUNNING.end-to-end evidence
An exact-base live A/B probe navigated to
example.com, calledawait browser.close(), then requested facade tools again:mainRUNNINGCOMPLETEDThe follow-up call on the changed implementation created a fresh session and closed it; both changed-side sessions reached
COMPLETED. The intentionally leaked base session was released after recording the result.The same eight public Online-Mind2Web-style prompts were run through the official Eve example on real Browserbase sessions. Each required navigation, multiple facade calls, snapshot/screenshot evidence, exact final title/URL, and browser close:
Nine sessions were created after the change because one unhealthy resource was replaced; all nine reached
COMPLETED. The unchanged judge miss was a canonical-hostname false negative. Remaining strict failures were snapshot transport churn and facade/navigation limitations, not lifecycle failures.test plan
eve buildNo changeset is included because the Eve integration is a private example.
Summary by cubic
Eve now closes and releases its facade-owned Browserbase session when model code calls await browser.close(), preventing reuse of a closed session and surfacing cleanup failures instead of hiding them. Before, close returned while Eve kept the session; now we await local cleanup, release via the shared helper, and create fresh resources on the next call.
releaseBrowserbaseSessionfrom@browserbasehq/stagehand-integrations/facade(replacing the prior best-effort REST call).BrowserbaseSessionReleaseError.AggregateErrorwhen multiple occur; a browser-close failure still surfaces even if remote release succeeds.Written for commit 96be869. Summary will update on new commits.