Skip to main content

Module agent_io

Module agent_io 

Source

Structs§

SendLaunch 🔒
The launch settings agent.send reads from the block’s metadata, shared by the persistent and subprocess dispatch.

Functions§

account_labels 🔒
This machine’s label for each account signed in on it, by the account’s stable id. An account with no stable id (an API key, say) is left out.
agent_bulk_stop 🔒
fleet.bulk-stop from the agent caller: its own block and its workers stop at once, every other agent’s opens the override window (pending in the answer) and stops when it runs out. A staged rollout can’t be applied to those windows (they all open at once), so it is refused when any target is another agent’s.
agent_list_entries 🔒
The agents of agent.list: every agent block in a tab or parked (a parked one has an empty tab_id).
agent_panes_of 🔒
Every pane of the agent whose definition id is agent_id, in every window and tab of this instance, running or not (a pane whose agent has stopped, a pane in a window nobody is looking at): where it is open, as open_agent_panes reports it. window_ids is empty for a pane no window shows. One agent should have one pane; a caller that is about to make one (an import, a restore, a drag) asks this first and reuses what it finds instead of creating a second.
agent_send 🔒
agent.send: deliver a message to the agent running in a block, by whichever controller type the block has.
agent_send_from 🔒
agent.send from a connection: the text goes into the agent’s input unmarked, as the person’s own turn, so only the AgentMux window sends it. An agent reaches another agent with the Message tool, which is delivered as a jekt.
agent_send_spawn_env 🔒
The environment an agent.send spawn is given: cmd:env through build_persistent_spawn_env, exactly as the agentinput path builds it — identity gate, MuxBus token, wrapper auth, agent identity (UID + token for a row-backed block, AGENTMUX_AGENT_ID from agentName when cmd:env lacks it), git identity, tools PATH. Identity M4b-1 (spec §6.5.8); factored out so the carriage is testable.
folder_gate 🔒
As agentinput does first: a harness other than Claude Code is not started on the host in a folder a container agent can write (mcp_folder_rule), and the pane is told why. A Claude turn there goes on, and the pane is told which servers of the folder’s own file it is not given. Asked off the async workers (it reads the disk).
open_agent_panes 🔒
Where each of block_ids is open: its agent, tab, and the windows showing its workspace. The agent is resolved like the rest of srv resolves a block’s agent (instance_get_active_for_block: agentId, the legacy agent:id, a template-launched row, the latest launch on the block) so a pane from an older build is not reported closed (Codex P1 on #4127); the raw meta id is the fallback when that finds no row. Blocks with no resolvable agent or no parent tab are skipped. Workspaces and windows are read once for the whole list.
override_window_for 🔒
The answer when agent.stop on cmd.block_id opened an override window for the agent caller (a connection’s registered agent, empty for the window), or None when the stop is immediate: the window’s own, the agent’s own block, or a worker it opened.
refuse_other_agents_processes 🔒
An agent’s connection ends processes only under its own block or a worker’s it opened. Another agent’s go through agent.stop, which gives the person their override window, so killing them directly would skip it.
refuse_spawn_gate 🔒
A pre-spawn identity gate refusal: put the error frame where the pane reads it, record the structured failure, and return the RPC error.
register
register_agent_kill_process 🔒
register_agent_kill_tree 🔒
register_agent_list 🔒
register_agent_open_panes 🔒
agent.open-panes: every agent pane in this instance, wherever it is. A renderer only knows the panes in its own window, so “is this agent open?” asked of a renderer misses one in a floating or other window — My agents then offered a reattach for an agent that was live, and the second pane could never run (SPEC_AGENT_SAME_PROCESS_DUPLICATE_PANE_ RECOVERY_2026_10_01.md §2 G0). Same source as agent.tracked-blocks.
register_agent_output 🔒
register_agent_process_list 🔒
register_agent_send 🔒
register_agent_status 🔒
register_agent_stop 🔒
register_agent_tracked_blocks 🔒
register_ambient_outcomes 🔒
ambient.outcomes: how ambient calls have ended since srv started, so “the swarm has been blank for an hour” is visible without a database copy (SPEC_AMBIENT_SWARM_SUMMARY_HARDENING_2026_10_02.md section 5.8).
register_swarm_other_instances 🔒
swarm.other-instances: this machine’s other channels (the host-global shared registry) and the LAN hosts (the LAN discovery peer list), with their agents’ names (Phases 1 and 2 of SPEC_SWARM_OTHER_HOSTS_AND_CHANNELS_2026_10_02.md) and, where their instance reports it, their state (Phase 4). No content, no credentials and no addresses. A peer’s agent’s account is named only when the same account is signed in here, and then by this machine’s own label for it.
send_via_persistent 🔒
agent.send to a persistent-CLI block. Returns the controller’s session id.
send_via_subprocess 🔒
agent.send to a per-turn subprocess block (a host CLI or a container exec).
show_refused_spawn 🔒
Put a refused spawn’s reason where the pane reads it, and record the structured failure.
stop_one_agent_block 🔒
Core agent.stop logic, factored out so fleet.bulk-stop (server/app_api/fleet.rs) can loop it per target instead of duplicating the controller-lookup/stop/status-read sequence.
window_caller_for 🔒
The agent an override window is opened for, when caller (a connection’s registered agent, empty for the person’s window) acts on block_id that is another agent’s: Some(by), the caller’s uid (its name when it has none). None for the window itself, the agent’s own block and a worker it opened, which it ends at once.