Skip to main content

Module orphan_reaper

Module orphan_reaper 

Source

Structs§

Scan 🔒
What one sweep finds: unplaced blocks (minus everything the module doc lists as never reaped, whatever their kind), and each stored tree’s validate_layout_invariants findings by tab.
Unplaced 🔒
A block in its tab’s block_ids but in no pane of the tab’s layout.
Watch 🔒
What sweeps carry between runs: each unplaced block’s first sighting (a block that got placed, or deleted, in between drops out), and the violations already logged, so each is logged once while it lasts.

Constants§

FIRST_SWEEP_DELAY 🔒
First sweep waits for the frontend to load and push its layouts.
MANAGEMENT_VIEWS 🔒
The built-in management views (the widget bar’s one-per-tab panes). They show the app’s own state, so a block of one that is in no pane holds no work: it is put back in a pane, or closed when it is a copy. Any other view (a terminal, an editor with unsaved text, a browser) is only reported, never moved or closed.
MIN_ORPHAN_AGE 🔒
How long a block must stay unplaced before it is reaped.
SWEEP_INTERVAL 🔒

Functions§

install
Start the periodic sweep. Called once from main after AppState exists.
is_agent_block 🔒
Whether block_id is an agent’s block, from its stored meta. Which panes Stop pane refuses and which blocks Stop agents accepts (docs/specs/SPEC_STOP_AN_AGENT_ONE_WAY_AND_SHUTDOWN_TOAST_2026_10_23.md §3.2).
is_agent_view 🔒
An agent’s block: the agent view, or a term block with an agentId in its meta (a terminal-tier agent).
pending_placement_blocks 🔒
Blocks named by a queued, not-yet-applied placement action (pendingbackendactions) in this tab’s layout row.
scan 🔒
sweep 🔒
One sweep. Returns the block ids it closed.