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