Skip to content

Runtime And Fleet

The runtime is a separate execution system, but the platform still owns the public control-plane routes that register, supervise, and configure it.

This section covers the platform-side management contracts for:

  • agents
  • workers
  • execution environments
  • fleet and live container state

POST /api/v1/agents/register

Scope: agent

Request body:

{
"name": "runtime-specialist",
"protocol": "rest",
"routing_tags": [
"typescript",
"reviewer"
],
"execution_mode": "specialist",
"issue_api_key": true,
"heartbeat_interval_seconds": 30,
"tools": {
"required": [
"shell_exec"
],
"optional": [
"web_fetch"
]
},
"metadata": {
"region": "local-dev"
}
}
FieldContractMeaning
namestringDisplay name for the registered agent.
protocolenumAgent protocol contract. rest is the normal runtime path; acp is for ACP-capable agents.
routing_tagsstring[]Claim filter tags that decide which tasks this agent is eligible to receive.
execution_modeenumWhether the agent behaves like a specialist, orchestrator, or hybrid.
issue_api_keybooleanWhether registration should mint and return a fresh agent API key.
heartbeat_interval_secondsintegerExpected heartbeat cadence for liveness supervision.
toolsstructured objectDeclared required and optional tool names for capability matching and operator visibility.
worker_idUUIDOptional backing worker record this agent belongs to.
metadataarbitrary JSON objectAdditional caller-supplied identity or environment details.
acpstructured objectACP capability declaration, including supported transports, session modes, and ACP-specific capability metadata.
profilearbitrary JSON objectExtra agent profile metadata for selection or introspection.

Response:

{
"data": {
"id": "99999999-9999-9999-9999-999999999999",
"name": "runtime-specialist",
"routing_tags": [
"typescript",
"reviewer"
],
"status": "active",
"api_key": "issued-agent-key",
"metadata": {
"region": "local-dev",
"protocol": "rest",
"execution_mode": "specialist"
},
"tools": {
"required": [
"shell_exec"
],
"optional": [
"web_fetch"
]
}
}
}

api_key is only present when registration is allowed to issue a new agent key.

FieldContractMeaning
idserver-generatedCanonical agent id.
routing_tagsserver-generated string[]Effective claim tags after normalization.
statusserver-generated enum-like stringCurrent agent status immediately after registration.
api_keyopaqueNewly issued agent API key when issuance is enabled.
metadataarbitrary JSON objectSanitized stored agent metadata.
toolsstructured objectEffective required and optional tool declarations.

POST /api/v1/agents/:id/heartbeat

Scope: agent

Response:

{
"data": {
"ack": true,
"status": "busy"
}
}

POST /api/v1/workers/register

Scope: worker

Request body:

{
"name": "local-codex-worker",
"runtime_type": "codex",
"connection_mode": "websocket",
"routing_tags": [
"typescript"
],
"heartbeat_interval_seconds": 30,
"host_info": {
"hostname": "devbox"
},
"agents": [
{
"name": "local-codex-specialist",
"routing_tags": [
"typescript"
],
"execution_mode": "specialist"
}
]
}
FieldContractMeaning
namestringWorker display name.
runtime_typeenumExecution family behind the worker, such as codex, acp, or external.
connection_modeenumHow the worker expects to receive work and signals.
routing_tagsstring[]Tags inherited into task claim filters for this worker.
host_infoarbitrary JSON objectMachine-level facts useful for operator diagnostics.
heartbeat_interval_secondsintegerExpected heartbeat cadence for worker supervision.
metadataarbitrary JSON objectExtra worker metadata.
agentsstructured object[]Optional specialist agents to create and attach to the worker during registration.

Response:

{
"data": {
"worker_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
"worker_api_key": "issued-worker-key",
"agents": [
{
"id": "99999999-9999-9999-9999-999999999999",
"name": "local-codex-specialist",
"routing_tags": [
"typescript"
],
"api_key": "issued-agent-key"
}
],
"websocket_url": "/api/v1/events",
"heartbeat_interval_seconds": 30
}
}
FieldContractMeaning
worker_idserver-generatedCanonical worker id.
worker_api_keyopaqueNewly issued worker API key.
agentsstructured object[]Any specialist agents created and attached during registration.
websocket_urlserver-generated stringPlatform websocket endpoint the worker should connect to.
heartbeat_interval_secondsserver-generated integerEffective worker heartbeat cadence after defaults are applied.

POST /api/v1/workers/:id/heartbeat

Scope: worker

Request body:

{
"status": "online",
"current_task_id": null,
"metrics": {
"queue_depth": 0
}
}

POST /api/v1/workers/:id/next

Scope: worker

Request body:

{
"agent_id": "99999999-9999-9999-9999-999999999999",
"workflow_id": "33333333-3333-3333-3333-333333333333",
"include_context": true
}

Response is either:

  • 204 No Content when no task is available
  • { "data": <claimed task> } when a task was claimed

POST /api/v1/execution-environments

Scope: admin

Request body:

{
"name": "Node 22 Tooling",
"description": "Runtime image with Node, git, and common build tools.",
"image": "ghcr.io/agirunner/agirunner-runtime:0.1.0",
"cpu": "2",
"memory": "4Gi",
"pullPolicy": "if-not-present",
"bootstrapCommands": [
"node --version",
"git --version"
],
"bootstrapRequiredDomains": [
"github.com"
],
"operatorNotes": "Default environment for TS delivery tasks."
}

Execution environment responses follow this broad shape:

{
"data": {
"id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
"name": "Node 22 Tooling",
"source_kind": "custom",
"catalog_key": null,
"catalog_version": null,
"image": "ghcr.io/agirunner/agirunner-runtime:0.1.0",
"cpu": "2",
"memory": "4Gi",
"pull_policy": "if-not-present",
"compatibility_status": "unknown",
"support_status": null,
"verification_contract_version": null,
"verified_metadata": {},
"tool_capabilities": {},
"bootstrap_commands": [
"node --version",
"git --version"
],
"bootstrap_required_domains": [
"github.com"
],
"agent_hint": "Execution environment: Node 22 Tooling"
}
}
FieldContractMeaning
source_kindenum-like stringWhether the environment was created manually or from a catalog seed.
catalog_key / catalog_versionstring / integerCatalog origin when the environment comes from a curated entry.
imagestringContainer image the runtime should launch for this environment.
cpu / memorystringResource requests or caps expressed as strings because they flow through platform config rather than a Go type system.
pull_policyenumImage pull behavior.
compatibility_statusenumCurrent verification verdict, such as unknown, compatible, or incompatible.
support_statusenum-like string or nullHigher-level support posture, for example whether operators have blocked or approved the environment.
verification_contract_versionstring or nullWhich verification contract version produced the current compatibility result.
verified_metadatastructured objectStructured verification evidence recorded by the platform.
tool_capabilitiesstructured objectTool or runtime capabilities discovered or declared for this image.
bootstrap_commandsstring[]Commands the verifier or runtime can run immediately after container start.
bootstrap_required_domainsstring[]Domains the environment must be able to reach for bootstrap or verification.
agent_hintserver-generatedPreformatted hint string the platform can show to help route agents toward the environment.

POST /api/v1/execution-environments/from-catalog

Scope: admin

Request body:

{
"catalogKey": "node-22",
"catalogVersion": 1,
"name": "Node 22 Tooling",
"description": "Customized from catalog starter."
}

POST /api/v1/execution-environments/:id/verify

Scope: admin

Response:

{
"data": {
"compatibility_status": "compatible",
"compatibility_errors": [],
"verification_contract_version": "v1",
"verified_metadata": {},
"tool_capabilities": {},
"probe_output": {}
}
}

The platform also exposes admin-facing fleet and container routes such as:

  • GET /api/v1/fleet/workers
  • GET /api/v1/fleet/live-containers
  • GET /api/v1/containers

These routes are primarily operator and diagnostics surfaces. Use them when you need live actual-state visibility rather than declarative task or workflow records.