Skip to main content

Module browser_hibernation

Module browser_hibernation 

Source
Expand description

An agent’s Browser call on a hibernated browser pane wakes it first (docs/specs/SPEC_BROWSER_PANE_HIBERNATION_2026_10_20.md §8).

A hibernated pane has no page: its window closed it to free memory and keeps browser:sleep in the block’s meta until a wake has loaded it again. srv can’t create the page itself (the window owns where it goes), so it asks: it writes browser:wake, which the pane’s view answers by waking, and waits for browser:sleep to clear.

Constants§

LAST_CALL_EVERY 🔒
A call is noted at most this often per pane: the window’s sleep time is minutes.
LAST_CALL_META_KEY 🔒
Block meta srv writes when an agent’s Browser call reaches the pane (ms). The action log holds only what changed the page, so a pane an agent reads (snapshot, find) would look unused; the window counts this too before letting it sleep.
POLL 🔒
SLEEP_META_KEY 🔒
Block meta while a browser pane is asleep or waking.
WAKE_META_KEY 🔒
Block meta srv writes to ask the pane’s view to wake it.
WAKE_TIMEOUT 🔒
How long a Browser call waits for a pane to wake before failing.

Functions§

asleep 🔒
call_due 🔒
Whether a call at now is due to be noted, given when the last one was.
ensure_awake 🔒
Wakes block_id if it is a hibernated browser pane, and waits for its page. Ok(true) when it was asleep and is awake now, Ok(false) when it wasn’t asleep (or isn’t a browser pane).
is_asleep 🔒
mark_woken 🔒
The host’s answer to a call that woke the pane, marked so the agent’s tool can say its page was reloaded.
note_call 🔒
Notes in the pane’s meta that an agent’s call reached it, at most once per LAST_CALL_EVERY. A failed write is only a missed note.
post_to_host_awake 🔒
Every srv call into the host’s browser API goes through here: a hibernated browser pane named by the body’s block_id has no page, so it is woken first, and the answer says so.