Synced from Hive. This page is pulled from hivecommons/hive@v5 during the docs build. Edit the canonical source in the Hive repository.

hive-status: agent health for the supervisor

hive-status is the supported way for the supervisor agent to read the health of the agents in its hive (#20372). It replaces reading /data/hive-state.json, which is restart backup state (see backup-restore.md) whose fields can change in any release.

hive-status faults            # one line per fault, or "no faults"
hive-status agents            # one line per agent
hive-status agents --json     # the versioned JSON below

--timeout <seconds> bounds the wait for the hive (default 60). The exit code is 0 whenever the hive answered, with or without faults; 1 when the hive refused the request or did not answer in time; 2 on a usage error.

How it is served

hive-status works like the other agent relays (hive-clone, hive-open-issue): it runs as the agent’s own UID and writes {"agent": "<name>"} into /var/run/hive-metrics/status-requests. The hive answers from the live agent statuses it already holds (the same snapshot it writes the state file from) and writes <request>.result.json next to the request. hive-status accepts the result only when the hive’s UID owns it and prints it. It cannot delete the result: the queue is sticky and the result is the hive’s file, so the hive sweeps settled files (results and .denied/.bad/.rejected requests) once they are five minutes old. No dashboard token and no file read under /data is involved.

The hive answers only when:

  • the request file is owned by a per-agent UID (a hive without per-agent UIDs refuses every request),
  • that UID belongs to exactly one agent, and it is the agent the request names, and
  • that agent is the supervisor (named supervisor, or bead_role: supervisor).

A refused request is renamed .denied, and its result carries the reason and no agent data.

What counts as a fault

A fault is a watchdog condition (Ready, Authenticated or Producing) with status False on an agent that is enabled and not paused. Unknown is not a fault: the watchdog could not tell. Cumulative history is not a fault either: restart_count and the state file’s turn_loss only grow, so they say nothing about current health.

hive-status faults prints one line per fault:

<agent> <Condition>=False <reason>[: <message>]

JSON (schema_version 1)

{
  "schema_version": 1,
  "at": "2026-11-29T10:00:00Z",
  "agents": [
    {
      "name": "scanner",
      "enabled": true,
      "paused": false,
      "paused_reason": "",
      "conditions": [
        {"type": "Ready", "status": "True", "reason": "ReadySignature", "since": "2026-11-29T09:00:00Z"},
        {"type": "Authenticated", "status": "False", "reason": "TokenExpired", "message": "refresh failed", "since": "2026-11-29T09:55:00Z"},
        {"type": "Producing", "status": "Unknown", "reason": "NotObserved"}
      ],
      "last_kick": "2026-11-29T09:50:00Z",
      "last_kick_outcome": "ended",
      "last_kick_outcome_reason": "",
      "restart_count": 3
    }
  ],
  "faults": [
    {"agent": "scanner", "condition": "Authenticated", "reason": "TokenExpired", "message": "refresh failed"}
  ]
}
FieldMeaning
schema_versionThe version of this shape. A change a reader could notice, other than a new field, bumps it.
atWhen the hive built the answer (UTC).
agents[]Every agent the hive runs, sorted by name.
enabled, paused, paused_reasonThe agent’s live configuration and pause state.
conditions[]Always the three watchdog conditions, in the order Ready, Authenticated, Producing. status is True, False or Unknown; a condition the watchdog has not observed yet reads Unknown with reason NotObserved. since is when the status last changed.
last_kickWhen the last kick was delivered; absent if the agent was never kicked.
last_kick_outcomeHow the last kick’s turn ended, as the hive classified it, or pending while that turn has not ended. last_kick_outcome_reason is the pane line behind a no-op verdict.
restart_countRestarts since the hive started tracking the agent. Cumulative, never a fault.
faults[]The faults, as defined above.

A condition message can quote a line from an agent’s pane. The role check limits who can ask for an answer, not who can read one: the hive writes the result as a mode 0644 file in the shared, group-readable request queue, so while it exists any agent in the hive group can read it. The hive removes it about five minutes after writing it, whether or not hive-status read it. This exposes nothing new, since /data/hive-state.json holds the same data and is group-readable too.