You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the Actor entity in Agent Substrate lacks support for arbitrary key-value metadata (labels/tags). As the platform grows, users and operators need a flexible way to categorize, group, and query active workloads without forcing database-specific indexing implementation requirements.
We propose adding a map<string, string> labels field to the Actor resource, enabling Kubernetes-style label selectors for filtering during ListActors requests.
Note
Performance Characteristic: ListActors is an operational control-plane query (used by command-line tools like kubectl-ate, admin UIs, and operator scripts) and is not on the latency-critical path for routing, scheduling, suspending, or resuming actors. Consequently, in-memory filtering at the service layer is acceptable and does not impact critical path latency.
User Stories & Use Cases
1. Ownership & Multi-Tenancy
As a developer using a shared Substrate cluster, I want to filter actor listings to only see my own workloads (e.g. owner=alice).
As a team lead, I want to list all actors billed to my team (e.g. team=checkout).
2. Environment & Resource Lifecycle Management
As an operator, I want to run a cleanup script that lists all actors in staging (e.g. env=staging) and deletes/suspends them at the end of the day, without affecting production workloads.
3. Business & Workflow Context
As a platform engineer, I want to look up an active agent instance by the customer id it is serving (e.g. customer_id=12345) to inspect its status or troubleshoot a support ticket.
As a scheduler developer, I want actors to carry constraints (e.g. gpu=required, region=us-central) so that the orchestrator can schedule them onto matching worker pods.
Proposed Design
1. Protobuf API Changes
We will update pkg/proto/ateapipb/ateapi.proto to include a labels map in the Actor message and the creation requests, along with a string-based label_selector for query filtering.
messageActor {
...
// Labels associated with the actor.map<string, string> labels=12;
}
messageCreateActorRequest {
...
// Optional labels to apply to the actor upon creation.map<string, string> labels=4;
}
messageListActorsRequest {
...
// An optional Kubernetes-style label selector query string (e.g. "env=production,app=billing").stringlabel_selector=3;
}
2. Database-Agnostic Filtering
To keep the persistence layer pluggable and simple:
The Database Interface (store.Interface) will remain simple and only handle standard paginated key scanning. It will not know about the filter criteria.
The Service Layer (controlapi.ListActors) will fetch the page of raw actors and apply the filter evaluation in memory using the Go k8s.io/apimachinery/pkg/labels package.
Since our Redis storage driver uses protojson for marshaling/unmarshaling, the new labels field will automatically persist to Redis without requiring schema changes or updates to Redis Lua scripts.
Implementation Plan
Update pkg/proto/ateapipb/ateapi.proto and re-generate Go protobuf bindings.
Update the persistence layer interface and implementations to support setting and retrieving labels.
Integrate k8s.io/apimachinery/pkg/labels at the service layer in cmd/ateapi/internal/controlapi/list_actors.go to filter list results before returning them.
Add unit and integration tests covering label assignment, persistence, and selector querying.
Currently, the
Actorentity in Agent Substrate lacks support for arbitrary key-value metadata (labels/tags). As the platform grows, users and operators need a flexible way to categorize, group, and query active workloads without forcing database-specific indexing implementation requirements.We propose adding a
map<string, string> labelsfield to theActorresource, enabling Kubernetes-style label selectors for filtering duringListActorsrequests.Note
Performance Characteristic:
ListActorsis an operational control-plane query (used by command-line tools likekubectl-ate, admin UIs, and operator scripts) and is not on the latency-critical path for routing, scheduling, suspending, or resuming actors. Consequently, in-memory filtering at the service layer is acceptable and does not impact critical path latency.User Stories & Use Cases
1. Ownership & Multi-Tenancy
owner=alice).team=checkout).2. Environment & Resource Lifecycle Management
env=staging) and deletes/suspends them at the end of the day, without affecting production workloads.3. Business & Workflow Context
customer_id=12345) to inspect its status or troubleshoot a support ticket.4. Scheduler Placement constraints (Future proofing)
gpu=required,region=us-central) so that the orchestrator can schedule them onto matching worker pods.Proposed Design
1. Protobuf API Changes
We will update
pkg/proto/ateapipb/ateapi.prototo include alabelsmap in theActormessage and the creation requests, along with a string-basedlabel_selectorfor query filtering.2. Database-Agnostic Filtering
To keep the persistence layer pluggable and simple:
store.Interface) will remain simple and only handle standard paginated key scanning. It will not know about the filter criteria.controlapi.ListActors) will fetch the page of raw actors and apply the filter evaluation in memory using the Gok8s.io/apimachinery/pkg/labelspackage.protojsonfor marshaling/unmarshaling, the newlabelsfield will automatically persist to Redis without requiring schema changes or updates to Redis Lua scripts.Implementation Plan
pkg/proto/ateapipb/ateapi.protoand re-generate Go protobuf bindings.k8s.io/apimachinery/pkg/labelsat the service layer incmd/ateapi/internal/controlapi/list_actors.goto filter list results before returning them.