Skip to content

runner, server: report COMPLETED and FAILED from the status file (#690) - #743

Closed
rakyll wants to merge 12 commits into
mainfrom
runner-status-file
Closed

rakyll wants to merge 12 commits into
mainfrom
runner-status-file

Conversation

@rakyll

@rakyll rakyll commented Nov 24, 2026

Copy link
Copy Markdown
Member

Updates #690 for COMPLETED and FAILED; REQUIRES_ACTION is not handled yet.

A task's command now says how the task ended by writing one JSON object, at most 16 KiB, to $AX_STATUS_FILE (<workspace>/.ax/status):

{"state": "COMPLETED", "message": "...", "output": "..."}

Runner

  • Exports AX_STATUS_FILE to the command and creates <workspace>/.ax.
  • Serves the file on GET /runner/v1alpha1/status, reading it on each request; the runner keeps no status in memory.
  • A file that can't be read, isn't JSON, is over 16 KiB or has an unknown state is served as FAILED with the error. With no file, the task has not ended.
  • The exit status is not a report. A command that exits without writing the file leaves the task Running.
  • Removes AX_OUTPUT_FILE; output in the status file replaces it.
  • Push endpoints are always served (AcceptPushes removed).

ax-server

  • Server.ObserveStatus (internal/server/observe.go) runs every 5 s. It lists running actors and asks each runner whose task has no stored state, 16 at a time. It stores the first COMPLETED/FAILED under the task lock: status.state, status.outcome.output, and Ready=False with TaskCompleted/TaskFailed.
  • GetTask/ListTasks never call the runner.
  • COMPLETED and FAILED stay through suspend and resume.
  • substrate.Client.ListActors takes optional states and filters client-side, since Substrate's ListActors has no state filter.
  • ax ssh also connects to a task that has an outcome.

Docs: DESIGN.md, docs/{runner,manifests,concepts,observability}.md, skills/substrate/SKILL.md, AGENTS.md, hack/hero-demo (output file removed).

Follow-up: #741.

Testing

  • make verify, go build ./cmd/ax ./cmd/ax-server ./cmd/ax-runner, go test ./...
  • Not run: E2E, the Postgres tier, make test-local-install. None of this has run in a real sandbox yet.

@rakyll rakyll self-assigned this Nov 24, 2026
@rakyll
rakyll force-pushed the runner-status-file branch from c641c36 to a988d03 Compare November 24, 2026 04:58
@rakyll
rakyll force-pushed the runner-status-file branch from acdfd5c to 9e62470 Compare November 24, 2026 05:18
Add a working queue (store.WorkingQueue, the working_tasks table) of the
tasks whose end is not recorded yet: ResumeTask queues a task, and
recording its end or deleting the task removes it. The loop that asks
runners how their tasks ended moves from internal/server to
internal/observer and goes through the queue, reading each task's actor
with GetActor.

The loop runs in a new binary, cmd/ax-observer, shipped in the ax-server
image and deployed as the one-replica ax-observer Deployment. ax-server
no longer runs it.
@rakyll

rakyll commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Closing in favor of #756. Task status will not contain anything from the data plane of the actor (how its command ended, its output, or retry context); an external orchestrator will manage task status and suspension/resumption. See also #747.

@rakyll rakyll closed this Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant