Skip to content

keepAlive sessions go COMPLETED within 500ms of CDP connect (Starter plan) #183

@Chipagosfinest

Description

@Chipagosfinest

Bug Report

Plan: Starter ($99/mo)
Project ID: e8975632-d34f-4ef5-b974-ea324e16c327
SDK: @browserbasehq/sdk 2.10.0
Region: us-west-2
Connect endpoint: connect-v2.usw2.browserbase.com

Problem

Sessions created with keepAlive: true and timeout: 900 go COMPLETED within 500ms-10s, regardless of whether a CDP connection is established.

Reproduction

const Browserbase = require('@browserbasehq/sdk');
const { chromium } = require('playwright');
const bb = new Browserbase({ apiKey: 'YOUR_KEY' });

const session = await bb.sessions.create({
  projectId: 'YOUR_PROJECT',
  keepAlive: true,
  timeout: 900,
});

// Session is RUNNING here
const browser = await chromium.connectOverCDP(session.connectUrl, { timeout: 10000 });
// Browser disconnects within 500ms

// Immediately after:
const retrieved = await bb.sessions.retrieve(session.id);
console.log(retrieved.status); // "COMPLETED" — should be "RUNNING"

Observed behavior

  1. Without CDP connect: Session goes from RUNNING → COMPLETED after ~10 seconds (polled every 1s)
  2. With immediate CDP connect: Browser disconnects within 500ms, session goes COMPLETED
  3. With active page navigation: Same — page.evaluate throws "Target page, context or browser has been closed"
  4. expiresAt is set correctly (15 minutes out), but session dies in seconds
  5. keepAlive shows true on the session object
  6. Project concurrency is 100 (confirming Starter plan is active)

Expected behavior

Session should remain RUNNING for timeout duration (900s) or until explicitly released via REQUEST_RELEASE. CDP connections should remain stable.

What I've ruled out

  • Docker/container issues: Same behavior on macOS host directly
  • NODE_TLS_REJECT_UNAUTHORIZED: Same behavior with and without
  • Playwright version: Tested with multiple versions
  • Race conditions: Session polled every 1s, consistently dies at ~10s mark without CDP
  • Session limits: Only 1 session at a time, concurrency limit is 100
  • connectUrl format: Using the signed connectUrl from session creation (wss://connect-v2.usw2.browserbase.com/?signingKey=...)

Environment

  • macOS Darwin 24.6.0
  • Node.js v25.2.1 (host) / v18.20.8 (Docker)
  • Playwright (latest)
  • @browserbasehq/sdk 2.10.0
  • Account created 2026-05-06

This is blocking production use. Appreciate a quick look!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions