Repository navigation
Description
Problem
With the mounted runner (#619–#622, released by #626), a pure agent image's only entry point is the launcher at /usr/local/bin/ax-harness. The runner only starts it when all of these hold (runner/launcher.go, launcherCommand):
spec.commandsis empty,spec.goal.textis non-empty,.ax/launcher-donedoesn't already match this input (it is written after the launcher exits).
So the launcher never runs for:
- Interactive tasks with no goal, which the code explicitly supports "so users can attach to the sandbox instead".
- Tasks that move from one-off to long-lived: a goal task that finished and is later resumed so a user can
ax sshin and keep working.launcher-donesuppresses the launcher on every later start. - Tasks with
spec.commands.
Even when it does run, the launcher is a child of the runner. Its environment and any setup it does in the process never reach an ax ssh session. ax ssh starts a fresh /bin/sh -i through the guest StartProcess with no Cwd and no Env (cmd/ax/main.go runSSH, internal/guest/client.go Exec). That shell:
- isn't explicitly given
spec.env(the runner adds it to the command's env; the ssh shell only inherits whatever the guest process server has), - gets none of the
AX_*_FILEcontract variables, - isn't a login shell, so
/etc/profile.ddoesn't run, - doesn't start in the workspace.
Why it matters
Image authors naturally put agent setup in the launcher: installing the agent CLI, setting sandbox env flags, pointing config and state at /workspace so they survive suspend, wiring MCP and credentials. A concrete case is agentexecutor/images#3/#4 (Claude Code). Its harness installs claude at startup when it isn't in the image, so:
- A user who creates a task without a goal and runs
ax sshfinds noclaudeat all. - A user who runs a goal task and then resumes it to continue interactively gets a sandbox without the harness's setup. Claude's state in
$HOMEis also lost on suspend, because only/workspacesurvives.
This is confusing, and it isn't documented: the same image behaves differently depending on whether a goal was set and whether the launcher already ran.
Options
- Document the split (minimum). In
docs/runner.mdand the prebuilt images guidance (Prebuilt images #493), say that the launcher is per-run only. Everything an interactive user needs belongs in the image: binaries,ENVsuch asCLAUDE_CONFIG_DIR=/workspace/..., and config files. Credentials and per-task values must not depend on the launcher. - Add a setup hook to the contract, for example
/usr/local/bin/ax-setup. It would be run by the runner on every start, after workspace prep and before the launcher or commands, whether or not a goal is set. It would be idempotent, and its output would go to an env file under/run/ax. - Make
ax sshsessions match the task's command environment. Passspec.env(or a sourced/run/ax/env) andCwd= the workspace path toStartProcess, and/or run the user's login shell, so interactive sessions see the same env as the launcher.
(3) seems needed regardless. (1) is cheap and should land before AX_RELEASE_RUNNER_VOLUME is turned on (#625). (2) is worth discussing as part of #493.
Related
#493 (prebuilt images), #619/#620/#621/#622 (mounted runner and launcher contract), #625/#626 (releasing ax-runner-volume), agentexecutor/images#3–#5 (Claude Code image).
Activity
siyuanfoundation commentedon Nov 18, 2026
Thanks @MushuEE for raising this.
Most of the assumptions here come from the legacy per-task ActorTemplate + AX_TASK_YAML + ax-harness / .ax/launcher-done flow.
Let's re-evaluate after v0.1 lands.