A few changes to the RPC methods for ActorSnapshot/ActorSnapshotTag. - #914
Open
Julian Gutierrez Oschmann (juli4n) wants to merge 1 commit into
Open
A few changes to the RPC methods for ActorSnapshot/ActorSnapshotTag.#914Julian Gutierrez Oschmann (juli4n) wants to merge 1 commit into
ActorSnapshot/ActorSnapshotTag.#914Julian Gutierrez Oschmann (juli4n) wants to merge 1 commit into
Conversation
See agent-substrate#912 for a more detailed description of the change. Fixes agent-substrate#912
Julian Gutierrez Oschmann (juli4n)
marked this pull request as ready for review
August 13, 2026 16:18
Zoe Zhao (zoez7)
approved these changes
Aug 13, 2026
| Actor actor = 1; | ||
|
|
||
| // Optional durable snapshot used to initialize the Actor. | ||
| ActorSnapshotRef source_snapshot = 2; |
Collaborator
There was a problem hiding this comment.
I see, we removed it here because the field is now in Actor itself. 👍🏼
|
|
||
| resp, err := client.TagActorSnapshot(ctx, &ateapipb.TagActorSnapshotRequest{ | ||
| Snapshot: &ateapipb.ActorSnapshotRef{Reference: &ateapipb.ActorSnapshotRef_Snapshot{Snapshot: &ateapipb.ObjectRef{Atespace: createTagAtespaceFlag, Name: createTagSnapshotFlag}}}, | ||
| Snapshot: &ateapipb.ObjectRef{Atespace: createTagAtespaceFlag, Name: createTagSnapshotFlag}, |
Collaborator
There was a problem hiding this comment.
Do we want the request to specify a atespace, or should the server always assign the tag the same atespace as the Snapshot itself?
| lock, snapshot, canonical, tag, err := s.lockActorSnapshot(ctx, ref) | ||
| var sourceSnapshotInfo *ateapipb.ActorSnapshotSource | ||
| if src := in.GetSourceSnapshot(); src != nil { | ||
| lock, snapshot, canonical, tag, err := s.lockActorSnapshot(ctx, nil, src.GetTag()) |
Collaborator
There was a problem hiding this comment.
Nit: do we want to separate lockActorSnapshot to both a GetActorSnapshot and a LockActorSnapshot?
| func (s *Service) lockActorSnapshot(ctx context.Context, ref *ateapipb.ActorSnapshotRef) (*store.Lock, *ateapipb.ActorSnapshot, *ateapipb.ObjectRef, *ateapipb.ActorSnapshotTag, error) { | ||
| _, canonical, _, err := s.getActorSnapshot(ctx, ref) | ||
| // lockActorSnapshot resolves and locks a snapshot by its canonical identity | ||
| // or by tag. Exactly one of canonical or tag must be set. |
Collaborator
There was a problem hiding this comment.
Exactly one of canonical or tag must be set.
Add a check for this to return error if both are set?
| // The tag specified by the caller at CreateActor. | ||
| ObjectRef tag = 1; | ||
|
|
||
| // Output only. Canonical (atespace, name) of the snapshot the tag |
Collaborator
There was a problem hiding this comment.
Also probably out of scope for this PR: I'm curious why this is output only? Why a snapshot must be tagged before we can use it in CreateActor()?
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.
GetActorSnapshotTagmethod for theActorSnapshotTagresource. The request should (as all Get requests) have a singleObjectReftag field.GetActorSnapshotRequestto have a singleObjectRefsnapshot field.Actor,calledsource_snapshot, which the following schema:See #912 for a more detailed description of the rationale for this change. Fixes #912