Skip to main content

carry_agent_workdir_env

Function carry_agent_workdir_env 

Source
pub(crate) fn carry_agent_workdir_env(
    env_vars: &mut HashMap<String, String>,
    block_meta: &HashMap<String, Value>,
)
Expand description

AGENTMUX_AGENT_WORKDIR: the agent’s own workspace, which the host-only “Your workspace” Operator Config entry tells it to clone and work in (SPEC_LAUNCH_CONTEXT_WORKSPACE_RULE_AND_STARTUP_FILES_2026_09_30.md §3.4). Server-set, like AGENTMUX_AUTH_KEY: it is the launch cwd (cmd:cwd), not user configuration, so a cmd:env copy never wins. Host agents only — a container’s cwd is a host path that means nothing inside the image (the key is also on CONTAINER_ENV_DENYLIST).

Exported as the absolute path the process actually starts in: ~ is expanded and a relative cmd:cwd is resolved against srv’s own cwd, as core::apply_working_dir does, so cd "$AGENTMUX_AGENT_WORKDIR" works from anywhere (Codex on #4113).