Skip to main content

Module agent_io

Module agent_io 

Source

FunctionsΒ§

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.
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.
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.
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.