Skip to content

Task creation fails on Substrate 6a35150 and later: AX still sends the removed snapshot_config.on_resume #443

Closed

Description

@eren23

What happens: On Agent Substrate 6a35150 or later, every ax apply of a Task fails:

Error: applying document 2: rpc error: code = Internal desc = provisioning task on substrate: ensuring actor: creating actor default/<task>: rpc error: code = FailedPrecondition desc = actor template not found

The ax-server log shows the real cause:

level=WARN msg="could not create custom ActorTemplate, falling back to default template" error="creating actor template default/<task>-tmpl-<hash>: rpc error: code = InvalidArgument desc = actor_template.snapshot_config: Invalid value: unknown field with protobuf tag 3"

Cause: internal/substrate/client.go:267 sets this on every template:

OnResume: &ateapipb.OnResumeConfig{
    FromData: ateapipb.ResumeSource_RESUME_SOURCE_GOLDEN,
},

agent-substrate/substrate#2105 (merged 2026-10-02 as 6a35150) removed on_resume, field 3 of SnapshotConfig. The Substrate API now rejects that unknown field. AX then falls back to default-template, which does not exist in a stock install (#366). So the Task fails with a message that hides the cause.

Reproduce:

  1. Install Agent Substrate 6a35150 on kind (hack/install-ate-kind.sh).
  2. Deploy AX ac23328 (current main).
  3. Run ax apply on any Task.

Suggested fix: Remove the OnResume block from internal/substrate/client.go, and update the github.com/agent-substrate/substrate module (go.mod pins 944abe3). The field has no replacement. After agent-substrate/substrate#2105, a data resume does not need the golden snapshot.

Older Substrate: Substrate 1d7ca8c also accepts a template without on_resume. I created an AX-shaped template without the field there (DATA snapshot scope, one durable dir). I ran 3 trials. Each trial created an actor, resumed it, suspended it at once, and resumed it again. All 3 second resumes worked. So the removal should not break installs that are not yet on 6a35150. Without the field, older Substrate uses its default resume source, RESUME_SOURCE_COLD_BOOT (cmd/ateapi/internal/defaults/defaults.go), not RESUME_SOURCE_GOLDEN.

Why it matters: agent-substrate/substrate#2105 fixes agent-substrate/substrate#2020. Before it, a Task that was suspended before its template had a golden tag failed on the next resume. AX cannot get that fix until it stops sending the field.

Environment: google/ax ac23328 and Agent Substrate 6a35150, on a local kind cluster (Docker Desktop on Apple Silicon), gVisor sandbox class.

Activity

  1. mayawang commented on Oct 2, 2026

    @mayawang
    Collaborator

    @rakyll @wenjiaswe @fedebongio tagging you on this one, since it blocks AX on current Substrate main and doesn't have an owner yet. Thanks @eren23 for the clear repro and for checking that the fix is safe on older Substrate too.

    One thing to plan for alongside the fix: agent-substrate/substrate#2102 (replace on_pause/on_commit/on_resume with capture_scope and minimum_resume_scope) and agent-substrate/substrate#2068 (golden snapshots become opt-out, with a wakeup probe required when they're on) change the same template fields again. It might be worth doing the port with those in mind. Happy to help, let me know.
    EOF

  2. Ethereal49 commented on Oct 3, 2026

    @Ethereal49

    I’m working on a minimal fix for this: stop emitting the removed on_resume field and update the pinned Substrate API, with regression coverage for the generated template. I’ll also check the older resume defaults and attempt the reported kind reproduction against both versions, documenting any verification limits. I’m using AI assistance and will keep the unrelated fallback behavior out of scope.

  3. Ethereal49 commented on Oct 3, 2026

    @Ethereal49

    @mayawang The minimal fix is ready on Ethereal49/ax, commit be7b1a8.

    The baseline reproduces the tag 3/fallback failure. The fixed version creates Tasks on Substrate 6a35150 and 1d7ca8c; two suspend/resume cycles retain the durable workspace marker, including cases with no golden snapshot tag. The 70 tests, builds, and module checks pass, and my Google Individual CLA is now on file. AI assistance was used, as noted in my earlier comment.

    The contribution guide describes submitting a PR from a fork, but the comparison page currently restricts PR creation to collaborators. Could you enable external PRs for this contribution, or advise the preferred way to submit the patch for review?

  4. eren23 commented on Oct 8, 2026

    @eren23
    Author

    A heads up for whoever picks this up. substrate#2309 was merged on Oct 7 and removed on_pause from SnapshotConfig with no compatibility shim. So be7b1a8 now fails on Substrate main too. Template creation fails with unknown field with protobuf tag 1, and every ax apply ends in actor template not found again.

    Not sending OnPause in BuildActorTemplate fixes it for me on main 36d6d22. I put it on a branch together with the fork fix here eren23@0a68792 and my chaos and 3 GiB suspend runs pass on it. I have not tried that change on older Substrate, where I think the validation still expects on_commit to be a subset of on_pause.

  5. eren23 commented on Oct 9, 2026

    @eren23
    Author

    One more since my last comment. substrate#2364 was merged today and renamed on_commit to preferred_fidelity, and it also renumbered SnapshotConfig. So an AX build that sends on_commit DATA (value 2 on tag 2) now asks for ROOTFS, which the API rejects at admission. Dropping on_pause is not enough on main anymore and every ax apply ends in actor template not found again.

    Bumping the substrate module to 288694e and asking for VOLUMES (the old DATA) works for me on main 288694e. It is on top of my earlier branch here eren23@6e1f5a5 and my chaos and 3 GiB suspend runs pass on it.

  6. siyuanfoundation commented on Oct 12, 2026

    @siyuanfoundation
    Collaborator

    /assign

  7. mastersingh24 commented on Oct 14, 2026

    @mastersingh24
    Contributor

    Thanks for the fix, @siyuanfoundation! One compatibility note for anyone landing here.

    #457 pins Substrate to a commit from main (f6a1dc72, Oct 9) that came after agent-substrate/substrate#2364, which renamed on_commit to preferred_fidelity and renumbered SnapshotConfig (storage_location moved from 4 to 1, and field 2 is now a different enum). So AX main no longer works against the v0.4.0 release: v0.4.0 rejects unknown fields, and the old and new numbering collide. Substrate v0.5.0 came out today and includes that commit, with the same SnapshotConfig layout. It might be worth bumping go.mod to the v0.5.0 tag and saying in the README that AX needs Substrate v0.5.0 or later, so people on v0.4.0 know to upgrade both together. (Suspended tasks won't carry over that kind of upgrade; when we went from v0.3 to v0.4 we did a fresh install and recreated our tasks.)

    Also, a heads-up from running our fork on v0.4.0 for the past week, in case resume-in-place comes up later. VOLUMES means a woken task restarts from its image with only its volumes restored. We used the v0.4 equivalent of MEMORY instead, so an agent wakes in about a second with its process still running. Two things bit us there:

    • A task whose command had already exited is still exited after it wakes, so anything that suspends tasks when their command exits needs to expect that.
    • A memory snapshot only restores on a host with the same CPU features. Our workers were on GKE E2 nodes that happened to be AMD; after we moved them to N4 (Intel), every suspended task failed to wake with incompatible FeatureSet: missing features: map[cmp_legacy cr8_legacy sse4a ...]. Keeping each worker pool on one CPU platform avoids it (N4 and C4 share a CPU and restore fine both ways).
  8. siyuanfoundation commented on Oct 15, 2026

    @siyuanfoundation
    Collaborator

    Thanks @mastersingh24 for the info! Bumping substrate version in #474

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