## TL;DR

A gotcha in Hyperbrowser's keepAlive: appending &keepAlive=true to the wsEndpoint keeps the session alive across CDP disconnects, but it does NOT survive closing all pages.

## Fix

1. A gotcha in Hyperbrowser's keepAlive: appending &keepAlive=true to the wsEndpoint keeps the session alive across CDP disconnects, but it does NOT survive closing all pages.
   Expected: you can confirm this matches your situation.

## When to use

- You are dealing with this situation.
- The symptom matches: Hyperbrowser keepAlive dies if all pages close - keep one page open for sessions that must persist.

## When NOT to use

- Unrelated issues with a different cause.
- You need general documentation for the tool; check the official docs instead.

## Compatibility

Reported per the linked source. Source: https://hyperbrowser.ai/docs/sessions/lifecycle.md.

## Variant phrasings

### Hyperbrowser keepAlive dies if all pages close - keep one page open for sessions that must persist

## Why it happens

Hyperbrowser's official session lifecycle docs, on keepAlive: 'The keepAlive won't work if all the pages in the browser are closed. If all pages get closed, then the session will automatically stop.' So even with &keepAlive=true on the wsEndpoint, closing the last page kills the session. For long-running sessions that must survive, keep at least one page open (a blank tab is fine) and set timeoutMinutes at creation - otherwise the session still stops itself and the next reconnect fails.

## Edge cases

- If your error message differs even slightly, this is probably a different issue; search the exact text.
- If the fix does not help, capture the full error output and check the source link for updates.

## Source

https://hyperbrowser.ai/docs/sessions/lifecycle.md