Replace supervisor with agentrun worker service

Move agent-run orchestration from the legacy supervisor path into the new
agentrun worker/service package and wire it through coredata, server,
policies, and GraphQL resolvers.

This consolidates run lifecycle handling around lease-aware workers and
aligns API surface with the new agent-run domain model so reviewers can
follow one coherent execution path.

Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
Bryan Frimin
2026-06-07 09:00:01 +02:00
parent 400800fd41
commit 3dfc833671
27 changed files with 1076 additions and 1260 deletions

View File

@@ -0,0 +1,60 @@
enum AgentRunStatus
@goModel(model: "go.probo.inc/probo/pkg/coredata.AgentRunStatus") {
PENDING
@goEnum(value: "go.probo.inc/probo/pkg/coredata.AgentRunStatusPending")
RUNNING
@goEnum(value: "go.probo.inc/probo/pkg/coredata.AgentRunStatusRunning")
SUSPENDED
@goEnum(value: "go.probo.inc/probo/pkg/coredata.AgentRunStatusSuspended")
AWAITING_APPROVAL
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.AgentRunStatusAwaitingApproval"
)
COMPLETED
@goEnum(value: "go.probo.inc/probo/pkg/coredata.AgentRunStatusCompleted")
FAILED
@goEnum(value: "go.probo.inc/probo/pkg/coredata.AgentRunStatusFailed")
}
enum AgentRunOrderField
@goModel(model: "go.probo.inc/probo/pkg/coredata.AgentRunOrderField") {
CREATED_AT
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.AgentRunOrderFieldCreatedAt"
)
}
input AgentRunOrder
@goModel(
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.AgentRunOrderBy"
) {
direction: OrderDirection!
field: AgentRunOrderField!
}
type AgentRun implements Node {
id: ID!
organization: Organization! @goField(forceResolver: true)
agentName: String!
status: AgentRunStatus!
errorMessage: String
startedAt: Datetime
createdAt: Datetime!
updatedAt: Datetime!
permission(action: String!): Boolean! @goField(forceResolver: true)
}
type AgentRunConnection
@goModel(
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.AgentRunConnection"
) {
totalCount: Int! @goField(forceResolver: true)
edges: [AgentRunEdge!]!
pageInfo: PageInfo!
}
type AgentRunEdge {
cursor: CursorKey!
node: AgentRun!
}

View File

@@ -311,6 +311,14 @@ type Organization implements Node {
orderBy: TaskOrder
): TaskConnection! @goField(forceResolver: true)
agentRuns(
first: Int
after: CursorKey
last: Int
before: CursorKey
orderBy: AgentRunOrder
): AgentRunConnection! @goField(forceResolver: true)
trustCenter: TrustCenter @goField(forceResolver: true)
customDomain: CustomDomain @goField(forceResolver: true)
trustCenterFiles(