Repository navigation
runner: hand the task to the image's launcher as files - #621
Merged
Merged
Conversation
aprajitaarora13
force-pushed
the
aprajitaarora/prebuilt-3-launcher-files
branch
from
November 17, 2026 00:24
504bf69 to
07a99eb
Compare
aprajitaarora13
marked this pull request as ready for review
November 17, 2026 00:33
mayawang
approved these changes
Nov 17, 2026
mayawang
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, this is the file contract the images should target: goal from spec.goal.text, answer in $AX_OUTPUT_FILE. I'll flag on the images PRs that they don't match yet. Non-blocking: a goal with no launcher serves forever with only a log line (a condition would help); the done marker is written even when the launcher fails, so a failure isn't retried on resume; and if an image sets a non-root USER, creating /run/ax may fail, worth checking.
aprajitaarora13
force-pushed
the
aprajitaarora/prebuilt-3-launcher-files
branch
from
November 17, 2026 02:13
07a99eb to
4d28328
Compare
aprajitaarora13
force-pushed
the
aprajitaarora/prebuilt-3-launcher-files
branch
from
November 17, 2026 02:18
4d28328 to
b2cc9a8
Compare
Base automatically changed from
aprajitaarora/prebuilt-2-mount-runner
to
main
November 17, 2026 02:20
Add the runner side of the prebuilt image contract. On every start the
runner writes the task as files and points the task's command at them,
so nothing per-task has to go into the container environment or the
ActorTemplate:
AX_GOAL_FILE /run/ax/goal.md spec.goal.text
AX_CONFIG_FILE /run/ax/config.json spec.config
AX_MCP_CONFIG_FILE /run/ax/mcp.json the Workspace's MCP servers,
in the {"mcpServers": ...} format
AX_SESSION_FILE /run/ax/session-id spec.session_id
AX_OUTPUT_FILE <workspace>/.ax/output, written by the launcher
The files under /run/ax are rewritten on every start, so a sandbox
restored from a snapshot never sees a stale goal. The output file is on
the workspace volume so it survives suspend; it is the path
TaskOutcome.output already documents.
When spec.commands is empty and the task has a goal, the runner starts
the image's launcher at /usr/local/bin/ax-harness, the path the images
in agentexecutor/images already use. Without a goal (or without a
launcher in the image) it keeps today's behavior and serves until
stopped, so users can attach with `ax ssh`. Tasks with spec.commands
get the same variables, and the launcher is not started for them.
After the launcher exits, the runner records a digest of its input in
<workspace>/.ax/launcher-done, so a resumed sandbox does not run a
finished one-shot task again; a new goal, config or session runs it.
MCPServers moves from claude-code-runner into package runner so both
use the same conversion.
Copying the output into status.outcome.output belongs to the Task
Runtime event reporting and is not part of this change.
Part of #493 (prebuilt agent images).
aprajitaarora13
force-pushed
the
aprajitaarora/prebuilt-3-launcher-files
branch
from
November 17, 2026 02:20
b2cc9a8 to
019bbcf
Compare
This was referenced Nov 17, 2026
Lukeluds
added a commit
to Lukeluds/ax-images
that referenced
this pull request
Nov 17, 2026
…_CONFIG_FILE servers Aligns ax-harness with the launcher contract in google/ax#621: the goal comes from spec.goal.text, the answer is written to AX_OUTPUT_FILE (and still printed to stdout), and the Workspace's MCP servers are registered with agy mcp add before the task runs.
Merged
This was referenced Nov 17, 2026
Merged
aprajitaarora13
added a commit
that referenced
this pull request
Nov 18, 2026
Follow up on the non-blocking review comments from #620, #621 and #622: - Only record `<workspace>/.ax/launcher-done` when the launcher exits with status 0, so a failed launcher run is retried when the sandbox is resumed. - Fall back to `<os.TempDir>/ax-run` when `Config.RunDir` is empty and `/run/ax` cannot be created (for example when a container image sets a non-root `USER`). - Start the task command or launcher (or skip it via `launcher-done`) before marking `/readyz?check=workspace` ready, so callers waiting on `ax resume` never race the start of a launcher run. - Reuse `${REGISTRY_ADDR}/ax-task-runner:base` (with `/usr/local/bin/ax-task-runner` removed) for `ax-e2e-launcher:e2e` so `hack/setup-e2e-kind.sh` avoids an extra Docker Hub pull. - Document on `substrate.MountRunnerVolume` that enabling `--runner-volume-image` sets the container command on all AX-managed templates, leaves user-managed `ate_actor_template` references untouched, and still expects `/bin/sh` and `git` in pure images when workspace setup (`spec.setup`) runs. Part of #493.
4 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds the runner side of the prebuilt image contract. On every start the runner writes the task as files and points the task's command at them. Nothing per-task has to go into the container environment or the ActorTemplate.
AX_GOAL_FILE/run/ax/goal.mdspec.goal.textAX_CONFIG_FILE/run/ax/config.jsonspec.configAX_MCP_CONFIG_FILE/run/ax/mcp.json{"mcpServers": ...}AX_SESSION_FILE/run/ax/session-idspec.session_idAX_OUTPUT_FILE<workspace>/.ax/outputTaskOutcome.outputalready documents/run/axare rewritten on every start, so a sandbox restored from a snapshot never sees a stale goal. The output file is on the workspace volume, so it survives suspend.spec.commandsis empty and the task has a goal, the runner starts the image's launcher at/usr/local/bin/ax-harness. That's the path the images inagentexecutor/imagesalready use.ax ssh.spec.commandsget the same variables, so any command can write$AX_OUTPUT_FILE. The launcher isn't started for them. If the files can't be written for such a task, the runner logs a warning and runs the command anyway.<workspace>/.ax/launcher-done. A resumed sandbox then doesn't re-run a finished one-shot task, but a new goal, config or session does run. This should line up with the task state machine work; happy to adjust.MCPServersmoves fromclaude-code-runnerinto packagerunner, so both use the same conversion.Copying the output into
status.outcome.outputbelongs to the runner's event reporting and isn't part of this PR.Tests: the launcher gets every file; a goal-less task doesn't start the launcher; a finished launcher isn't restarted for the same goal but is for a new one; commands get the variables; a missing launcher serves;
MCPServers.Part of #493.
Stack (review in order):