Skip to main content

base_env

Function base_env 

Source
fn base_env(
    req: &ShellCreateRequest,
    agent_block: Option<&Block>,
) -> HashMap<String, String>
Expand description

Env parity with the agent CLI: start from the agent block’s stored cmd:env (the per-agent env the agent process is launched with — same shape app_api/agent_io.rs / agent_handlers/input.rs read), then let the caller-supplied req.env override on top (explicit Shell env wins).

NOT forwarded here: the dynamic identity bindings (identity/resolver/inject.rs) and the bundled tools/bin PATH prefix that build_persistent_spawn_env (agent_handlers/input.rs) and blockcontroller/shell/lifecycle.rs inject at agent-CLI spawn time — those are resolved live per spawn, not stored in cmd:env. The MCP server (agentmux-mcp) is itself launched by the agent CLI through the bundled tools/bin, so tools it spawns inherit that PATH; shells created here run from agentmux-srv’s env plus cmd:env + req.env.