Skip to content

fix(substrate): read the held snapshot from the actor snapshots list - #137

Merged
Anish Ramasekar (aramase) merged 5 commits into
mainfrom
aramase/i/fork_held_snapshot_list
Oct 16, 2026
Merged

Anish Ramasekar (aramase) merged 5 commits into
mainfrom
aramase/i/fork_held_snapshot_list

Conversation

@aramase

Copy link
Copy Markdown
Collaborator

agent-substrate replaced ActorStatus.external_snapshot with a snapshots list, so the adapter read no snapshot and a stateful fork failed with ErrNoSnapshotToClone. First of the five PRs split out of #134, as Tom Gamble (@gambtho) suggested.

  • The adapter takes the held snapshot as the highest-generation entry whose durable copy is COMPLETED, the one substrate restores and tags.
  • integrations/substrate builds against substrate 96dffb28; the CI cluster moves to the same commit and the deploy/substrate WorkerPools use sandboxClasses.
  • Fork tests pick the snapshot from the list in the fake.

Depends on: nothing; branches off main. #134's fork identity checks (refuse a replaced parent, classify tag races) need the actor UID, so they moved to the next PR.

Testing: go test -race ./... in the root and integrations/substrate.

@gambtho Tom Gamble (gambtho) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Selection matches Substrate's resume and tag rule (highest-generation COMPLETED), and pending, local-only and missing statuses all refuse. Small things:

  1. integrations/substrate/adapter.go:180: when the newest COMPLETED generation has an empty URI, this skips to an older one, while Substrate's findLatestDurableSnapshot would tag the newest. Server validation should prevent it, but I'd pick the highest COMPLETED generation first and return its URI or "" (and flip the test at adapter_test.go:235), so the tag can't copy a different snapshot than the one checked.
  2. CHANGELOG.md:24: against an older ate-api, a fork through the Placer stops as unplaceable (placement.go:1165); only a direct Backend.Fork returns ErrNoSnapshotToClone. Maybe "refuses as unplaceable (no external snapshot handle)", and the upgrade-together note under Compatibility too.
  3. adapter_test.go:28,42: fakeControl.resumed is never set; looks left over from #134.

@aramase
Anish Ramasekar (aramase) marked this pull request as ready for review October 15, 2026 22:58
@aramase

Copy link
Copy Markdown
Collaborator Author

Thanks Tom, all three addressed:

  1. heldSnapshot now picks the highest-generation COMPLETED entry first (the later entry on a tie, as substrate's latestSnapshot does) and returns its URI or "", so an empty URI refuses instead of falling back to an older generation; test flipped, tie case added (f2b2eca).
  2. Reworded to "refuses as unplaceable (no external snapshot handle)" and added the upgrade-together note under Compatibility, which also says a direct Backend.Fork returns ErrNoSnapshotToClone; fixed the same claim in the adapter comments and pinned the Placer refusal with a test (4e10159, 2086c35).
  3. Removed fakeControl.resumed (a0924a4).

@gambtho Tom Gamble (gambtho) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All addressed, thanks. LGTM.

@aramase
Anish Ramasekar (aramase) merged commit 5ac10b1 into main Oct 16, 2026
7 of 8 checks passed
@aramase
Anish Ramasekar (aramase) deleted the aramase/i/fork_held_snapshot_list branch October 16, 2026 01:16
Tom Gamble (gambtho) added a commit to gambtho/agentsessions that referenced this pull request Oct 16, 2026
Adapt branch-only approval and deletion fixtures to the snapshot fidelity/list API in main agent-primitives#137.
Tom Gamble (gambtho) added a commit to gambtho/agentsessions that referenced this pull request Oct 16, 2026
Adapt branch-only approval and deletion fixtures to the snapshot fidelity/list API in main agent-primitives#137.
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.

2 participants