Skip to main content

Module agent_block

Module agent_block 

Source
Expand description

An agent’s block, found by the agent and not by a tab (docs/specs/SPEC_ALWAYS_AVAILABLE_AGENTS_2026_10_27.md §3.1, §3.3 rule 1): one block per agent, in a tab or parked in none. Everything that wants “the agent’s pane” asks here instead of scanning one tab, so a pane in another window, or none, is still found.

Structs§

AgentBlock 🔒
An agent’s block and the tab it is in. tab_id is None for a parked block.

Enums§

AgentPanePlan 🔒
What an agent’s open does about its pane: the one rule for every path that would add an agent pane (agent.open, a start, a layout import, a restore), so none of them makes a second.

Functions§

agent_blocks_by_uid 🔒
Every block of the agent with this UID that is in a tab or parked, the one that keeps the agent first. One that was refused for a conversation open in another pane comes last (another block holds it), then the one with a live controller wins, then one in a tab over a parked one, one in a tab a window shows over one in a closed workspace, then the one the agent last launched (its newest), then the lowest id (so the answer is stable).
blocks_in_tabs_or_parked 🔒
Every block that is in a tab or parked, each with its tab (None when parked). The agent readers that used to walk tabs’ blockids use this, so a headless agent’s parked block is not missing from them. An unmarked block in no tab is an orphan and is left out.
controller_is_live 🔒
Whether the block runs its agent now: a controller that has not ended. A stopped one stays registered, so presence alone would not tell it from a running one.
decide_agent_pane 🔒
Where the agent’s pane goes: its existing block, wherever it is, else a new one.
default_to_callers_tab 🔒
An open by an agent that names no tab goes to the tab that agent is in (a parked one, its home tab), not to whichever tab the person has active: the seat rule has a leader open agents into its own tab.
describe_tab 🔒
Where a tab is, for a person: “Window name > Tab name” (the window by its name, else its number).
find_agent_block_by_uid 🔒
The block of the agent with this UID, in any tab or parked. None when it has none.
is_agent_block_of 🔒
A block launched from a template keeps the template’s id in agentId and binds its agent through agentInstanceId, so the bound instance counts too.
is_parked 🔒
lost_the_conversation 🔒
Whether the block failed to open because the agent’s conversation is open in another pane (open_in_other_pane): it is not the one that holds the conversation.
parked_agents_tab 🔒
The tab a parked agent works from, so its workers open beside it and not in whatever tab the user is looking at: the tab its pane was parked from, else a tab one of its open workers is in.
resolve_tab_id_or_active 🔒
resolve_tab_id_for_block, and for a parked block, which no tab holds, its agent’s home tab (parked_agents_tab) and only then the active tab: a headless agent that spawns or opens panes has no tab of its own to use.
shown_tabs 🔒
The tabs windows show now (and those restored windows have waiting to open). A tab of a workspace no window shows is saved contents: it comes back only by opening that workspace.