fix: use correct Browserbase API to release sessions (#707)
Browserbase has no DELETE endpoint for sessions. The correct API is
POST /v1/sessions/:id with body { status: "REQUEST_RELEASE" }. The old
DELETE call returned an error that was silently swallowed, causing every
session to leak until the 30-min idle timeout.
Fixed in both Node.js (src/browser.ts) and native Rust
(cli/src/native/providers.rs) paths.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
db3d23d496
commit
89f9c97ac2
+8
-2
@@ -862,12 +862,18 @@ export class BrowserManager {
|
||||
* Close a Browserbase session via API
|
||||
*/
|
||||
private async closeBrowserbaseSession(sessionId: string, apiKey: string): Promise<void> {
|
||||
await fetch(`https://api.browserbase.com/v1/sessions/${sessionId}`, {
|
||||
method: 'DELETE',
|
||||
const response = await fetch(`https://api.browserbase.com/v1/sessions/${sessionId}`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-BB-API-Key': apiKey,
|
||||
},
|
||||
body: JSON.stringify({ status: 'REQUEST_RELEASE' }),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to close Browserbase session: ${response.statusText}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user