Skip to content

Pure agent images have no setup hook for interactive / long-lived sandboxes (ax ssh); the launcher only runs for goal-driven tasks #632

Open

Description

@MushuEE

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.commands is empty,
  • spec.goal.text is non-empty,
  • .ax/launcher-done doesn't already match this input (it is written after the launcher exits).

So the launcher never runs for:

  1. Interactive tasks with no goal, which the code explicitly supports "so users can attach to the sandbox instead".
  2. Tasks that move from one-off to long-lived: a goal task that finished and is later resumed so a user can ax ssh in and keep working. launcher-done suppresses the launcher on every later start.
  3. 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_*_FILE contract variables,
  • isn't a login shell, so /etc/profile.d doesn'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 ssh finds no claude at 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 $HOME is also lost on suspend, because only /workspace survives.

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

  1. Document the split (minimum). In docs/runner.md and 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, ENV such as CLAUDE_CONFIG_DIR=/workspace/..., and config files. Credentials and per-task values must not depend on the launcher.
  2. 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.
  3. Make ax ssh sessions match the task's command environment. Pass spec.env (or a sourced /run/ax/env) and Cwd = the workspace path to StartProcess, 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

  1. siyuanfoundation commented on Nov 18, 2026

    @siyuanfoundation
    Collaborator

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions