Skip to content

Feature Request: Add Method to Manually Close/Kill a Session #146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
AleefBilal opened this issue Apr 7, 2025 · 1 comment
Open

Feature Request: Add Method to Manually Close/Kill a Session #146

AleefBilal opened this issue Apr 7, 2025 · 1 comment

Comments

@AleefBilal
Copy link

AleefBilal commented Apr 7, 2025

Currently, there is no available method to explicitly kill or close a session after a desired operation has been completed using the Browserbase SDK or API that is designed for Playwright.

While it is possible to set an timeout as a workaround, it is not an optimal solution. This approach lacks precision and does not offer the control that a direct method (e.g., session.close() or session.terminate()) would provide.

Why this is important:

  • Allows developers to gracefully end sessions immediately after their task is done.
  • Helps manage session usage and API costs more effectively.
  • Reduces unnecessary wait times or reliance on time-based workarounds.

Request: Please consider adding a dedicated method to manually close or kill sessions programmatically.

Thanks!

@sevakgavel
Copy link

Ran into the same question. From the docs, it looks like the intended way to programmatically end a keepAlive session is client.sessions.update(session_id, status='REQUEST_RELEASE').

For normal sessions, closing the Playwright connection (browser.close()) should trigger auto-termination.

Agree that an explicit close() or terminate() method would be clearer though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants