Agent heartbeat
Updates the last-seen timestamp for an agent instance and optionally reports its current status.
Body
Heartbeat payload posted by an agent instance.
Accepts either the raw payload (shown below) or a shared
AgentVerbEnvelope wrapper of the same shape. The gateway normalises
both forms before handling the request.
Enveloped form:
{
"v": 1,
"id": "<uuid-v7>",
"ts": "2026-04-17T13:41:22.814Z",
"payload": { "instance_id": "...", "current_sessions": 3 }
}All fields other than instance_id are optional. Agents should emit
a heartbeat every 30 s (the shared HEARTBEAT_INTERVAL_MS) and
immediately on any status change. The same payload shape is sent as
a heartbeat frame over the connected-mode WebSocket.
The registered instance sending the heartbeat.
Self-reported routing liveness. Optional — if omitted the gateway keeps the previously reported value.
available, busy, draining, offline, unhealthy, unknown Number of sessions currently bound to this instance. Drives the least-loaded router tie-break.
x >= 0Upper bound on concurrent sessions. 0 means unlimited.
x >= 0Number of consecutive dispatch failures observed by the agent. Informational; the mesh tracks authoritative failure counts server-side.
x >= 0Response
Heartbeat acknowledged.
