Expand description
When a background browser session closes by itself (docs/specs/SPEC_BACKGROUND_BROWSER_SESSIONS_2026_11_28.md ยง4 item 9): its agent was stopped, the agent has done nothing for an hour, or the app restarted. A session has no window the person sees, so one nobody closes would hold a page, its memory and its sign-in for as long as the app runs. A pane the person Showed is a pane, not a session, and none of this touches it.
Constantsยง
- IDLE_
LIMIT_ ๐MS - How long the agent can do nothing before its sessions close: its transcript has not been written for this long.
- RESTART_
CLOSE_ ๐DELAY - How long after srv starts the sessions the last run left are closed: the workspace is loaded by then.
Staticsยง
- STOPPED ๐
- The agent panes whose agent was stopped, whose sessions the next sweep closes.
Functionsยง
- close_
due ๐ - The sessions that are due to close: those of an agent that was stopped, and of one that has done nothing for an hour. Called every minute and when an agent is stopped.
- close_
for_ ๐stop - The agent in the pane
agent_blockwas stopped: its sessions close with it, at once (the sweep is woken). A Stop docks only the floating panes the person sees, so nothing else would end them. Not closed here: the teardown that calls this is itself part of closing a pane, and a close from inside it would be a cycle. - close_
left_ ๐by_ the_ last_ run - The sessions the last run left close: a session is not restored.
- close_
one ๐ - Close the session
sforwhy, now: the person is not asked to keep it (a tab the agent closes itself has that window; a session has no window to ask in, and one that was kept would be asked about again every minute). The Audit row is written once the pane is closed, with the site read before it goes. - close_
stopped ๐ - The sessions of the agents stopped since the last sweep close.
- held_by ๐
- The sessions held by the agent pane
agent_block. - idle_
for_ ๐the_ limit - Whether an agent last active at
last_mshas been idle for the limit atnow_ms.