Skip to main content

Module identity

Module identity 

Source
Expand description

The agent’s identity variables in its spawn environment, beyond what input.rs’s split_agent_identity_env and carry_agent_uid_env set.

The server wins on identity (SPEC_FORK_SLUG_MIGRATION_2026_10_22.md P0.3): when the agent’s row has a slug, AGENTMUX_AGENT_ID, MUXBUS_AGENT_ID and the git identity AgentMux derived from the id come from that slug, whatever a persisted cmd:env says. cmd:env is a launch-time snapshot, so after a rename it names the old id, and the agent would keep answering to it. AGENTMUX_AGENT_SLUG is set the same way (split_agent_identity_env), and GH_CONFIG_DIR follows the slug (gh_guard). An agent with no row or no slug keeps its cmd:env values.

Functions§

block_agent_slug
The definition’s slug for the agent on block_id, if its row has one. For an env built from the agent’s stored cmd:env outside a spawn, so it skips the token mint and key ensure a spawn’s lookup does. A store error reads as no slug.
carry_block_slug_identity_env
[carry_slug_identity_env] for the agent on block_id; nothing for a block with no row slug.
pty_child_identity_env
The identity an agent’s PtyShell child carries, as its cmd:env, from the agent’s env after [carry_slug_identity_env]: its slug and git identity, so a commit typed there is the agent’s. Deliberately not AGENTMUX_AGENT_ID or MUXBUS_AGENT_ID: those are the agent’s address, and an interactive shell exporting AGENTMUX_AGENT_ID reports it through its shell integration (OSC 16162 E), which registers that pane as the agent for message delivery (termagent.ts), beside the agent’s own pane.