Skip to content

Workspace maiden-run marker under /ax is lost on volumes-only resume #518

Closed
rkb32/ax
#4

Description

@moficodes

Problem

internal/substrate/client.go configures every Task with PreferredFidelity: SNAPSHOT_FIDELITY_VOLUMES and DurableDirs: []string{"/workspace"}. As noted in #486, resuming from a volumes-only snapshot boots the container fresh from the image and restores only /workspace.

docs/runner.md notes that workspace setup markers must live on the durable volume so resume skips setup:

Record that setup happened somewhere on the durable volume or in a known location, per workspace, then skip the work on later boots. Resume restarts the container, and re-cloning into a restored workspace would destroy the agent's state.

However, internal/workspace/setup.go sets DefaultAXDir = "/ax" on the root filesystem and writes the maiden-run marker to /ax/initialized-<path>. Because /ax is outside /workspace, a volumes-only suspend and resume loses the marker file. On resume, SetupWorkspace runs a second maiden setup against the restored /workspace:

  1. writeFiles overwrites any inlined spec.files (such as AGENTS.md) that the agent or user edited.
  2. cloneRepos runs git checkout -f FETCH_HEAD, wiping uncommitted changes in cloned repositories.
  3. runBootstrap runs antigravity_bootstrap.py again if a workspace goal is set.

Suggested fix

Store the maiden-run marker inside the target workspace directory (for example <targetPath>/.ax-initialized or under /workspace/.ax) or include /ax in DurableDirs so the marker survives SNAPSHOT_FIDELITY_VOLUMES suspend and resume cycles.

Activity

  1. added
    devx
    on Oct 27, 2026
  2. mayawang commented on Oct 27, 2026

    @mayawang
    Collaborator

    Thanks @moficodes, confirmed: only /workspace survives a volumes-only resume, so the setup marker under /ax is lost and setup runs again on every resume. Related to #486 (what survives a suspend).

  3. rkb32 commented on Oct 29, 2026

    @rkb32
    Contributor

    Hey @mayawang, can I take this one? My plan is to save the setup marker inside /workspace instead of /ax, since /workspace is the only folder that comes back after a resume, and the runner docs already say to keep it on the durable volume. That way I don't touch the snapshot settings #486 is working on. I'll add a test that checks setup only runs once, and fix the line in docs/runner.md that mentions /ax. I'll push it to my fork.

  4. mayawang commented on Oct 29, 2026

    @mayawang
    Collaborator

    Yes please, go for it! Plan sounds right to me

  5. rkb32 commented on Nov 1, 2026

    @rkb32
    Contributor

    Hi @mayawang, the fix for #518 is ready in rkb32#4 (branch fix-setup-marker-minimal, one commit on current main). It moves the maiden-run marker onto the workspace volume. CI is green, and Codex found no major issues on the same code. Could you open the upstream PR from rkb32/ax:fix-setup-marker-minimal? PR creation is collaborator-only (#448).

  6. rkb32 commented on Nov 2, 2026

    @rkb32
    Contributor

    Thanks @mayawang! I've amended the commit to use my GitHub noreply address, so the CLA check should now match. I also removed the keep-existing-file change, so a declared spec.files entry overrides the repo copy again. I can open a separate issue for it if we want that protection back. The CLA check passes on the current head; CI is still running on it.

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

Metadata

Metadata

Assignees

Labels

P0devx

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions