Skip to content

Add plumbing to allow ateom to suspend actors - #1779

Merged
Luiz Oliveira (laoj2) merged 1 commit into
agent-substrate:mainfrom
sfunkenhauser:ateom_suspend_api
Sep 24, 2026
Merged

Luiz Oliveira (laoj2) merged 1 commit into
agent-substrate:mainfrom
sfunkenhauser:ateom_suspend_api

Conversation

@sfunkenhauser

Copy link
Copy Markdown
Collaborator

Part of #483

  • [ x ] Tests pass
  • [ x ] Appropriate changes to documentation are included in the PR

if errs := validateActorRef(req.GetActor(), field.NewPath("actor")); len(errs) > 0 {
return nil, status.Errorf(codes.InvalidArgument, "invalid actor: %v", errs.ToAggregate())
}
if req.GetActorUid() == "" {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we use the generated DV validations instead? Can we follow the same pattern we follow in the control API of having a validate method that calls the generated DV code and call it from here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I don't want workerserve to depend on controlapi which is where the generated DV code currently lives. We should probably move the generated DV code to a neutral apivalidation package which can be imported into both api surfaces.

This would be a pretty significant refactor, can we do this as a follow up PR?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Agree. We can do it in a follow up. I wanted to move the validations to a separate package (under cmd/ateapi/internal) for other reasons.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe add a TODO comment in the code to remove the hand-written validations and use DV?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done

Comment thread pkg/proto/ateapipb/ateapi.proto Outdated
// SetWorkerCapacity, naming the Worker its caller proved itself to be. The
// control plane serves it only for an Actor that is assigned to that Worker.
//
// Idempotent in the same sense SuspendActor is: the workflow fast-forwards

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this true? It looks like if the actor is suspended, the method returns NOT_FOUND.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Updated the comment to reflect the state of the code. We don't want this method to be idempotent as:

  1. An already suspended actor no longer belongs to this worker, and this worker shouldn't be able to know it exists or make calls against it.
  2. When moving to FGA for validation, depending on the actor state will make things more complicated.

@laoj2
Luiz Oliveira (laoj2) added this pull request to the merge queue Sep 24, 2026
Merged via the queue into agent-substrate:main with commit fa24dcc Sep 24, 2026
11 checks passed
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.

3 participants