rookone doctor
What rookone doctor checks, its stable check ids, the --json contract and the exit code.
rookone doctor answers one question: does RookOne work on this machine, and if
not, what do you run next. It never changes anything, apart from the side
effects listed under Server checks and
Sign-in checks.
On a fresh Linux home with no system keyring, Doctor reports file-backed vault
setup as pending and points to rookone login. Sign-in prepares the owner-only
key before requesting a device code.
See headless Linux setup.
rookone doctor # one screen in plain words
rookone doctor --verbose # every check, with its id and fix
rookone doctor --json # the same checks, for scripts and agents
rookone doctor --as alice # also check one agent's keys and server accessWhen the local stack or inbox mirror is stopped, including after restoring an
agent, the friendly Next hint is rookone start --background. An actionable
repair takes precedence over the generic suggestion to run doctor --verbose.
The JSON contract
rookone doctor --json prints one object:
{
"schema_version": 1,
"checks": [
{
"id": "server.reachable",
"status": "fail",
"summary": "GET /health failed: could not connect to https://api.rookone.io",
"cause": "could not connect to https://api.rookone.io",
"fix": "Check the deployment URL (ROOKONE_RELAY_URL or ROOKONE_CLOUD_URL), network, proxy and VPN, then try again.",
"evidence": {"mode": "connect_failed", "url": "https://api.rookone.io"}
}
],
"summary": {"pass": 30, "warn": 1, "fail": 1, "skip": 12, "not_run": 3}
}idis stable. Scripts match on it, never onsummarytext.statusis one of:pass: the check ran and found nothing wrong.warn: something is degraded but still works. Readfix.fail: something does not work. Readfix.skip: the check does not apply here (for example, server checks on a machine whose agents are all local-only).not_run: a required check applies but could not be measured, or a check it depends on did not pass.causeexplains what blocked it; readfix.
causeandfixare always filled in forwarn,failandnot_run.fixis a command you can run, or the next concrete step.evidenceholds the facts behind the verdict: paths, ports, HTTP status,error_code,request_id.
Exit code. rookone doctor exits 1 when any check has status fail or
not_run, and 0 otherwise. An inapplicable skip does not fail the run. A warning does not change the exit code, so a script that must
notice warnings has to read summary.warn.
Server checks
The server checks run for the agent you select with --as (or
ROOKONE_AGENT). Without a selection, doctor inspects the whole
installation, and the server checks report skip.
- A hosted deployment answers
GET /health. A self-hosted server answersGET /healthz(liveness) andGET /readyz(readiness,server.ready). server.agent_admittedasks the deployment whether it still admits the agent. On hosted it callsGET /api/v1/agents/me/blocked, which refuses a suspended agent or an account with no service. As a side effect, the call marks the agent as recently active. On a self-hosted server it exchanges the agent's credential atPOST /api/v1/auth/token, which refuses a revoked agent. As a side effect, the exchange extends the credential's expiry, as every client command does.- A refusal retains the deployment's
error_codeandrequest_idin diagnostic evidence, so support can find the request. The server's explanation is shown when supplied. For code-only refusals, the client supplies a recovery sentence: sign in again for an ended sign-in, or ask the administrator when your role does not allow the action. For a signed-roster invitation refusal, request an invitation from a current member. A restricted-host refusal explains that a host can manage only its own agents and sign out itself. The refused operation requires a CLI or browser device. A cut-off agent gets instructions to back it up, remove its local copy with--force-local --backup-file <that path>and register a replacement. An unrecognized code-only 4xx refusal asks you to runrookone doctorfor details. A server failure (5xx) with no explanation says the server could not complete the request and to try again shortly.
Sign-in checks
On the hosted service, an agent whose API key is refused recovers by proving its
root key. That needs a person signed in on this machine (rookone login) for the
agent's organization. A service key or ROOKONE_OWNER_TOKEN does not count.
owner.sessionchecks the sign-in of the account in use on hosted RookOne or a self-hosted server, andagent.recoverablechecks the sign-in each agent's organization would use, on hosted or on a self-hosted server. Each organization is checked once.- Doctor does what recovery would do. If the short access token is about to run
out, it is renewed, as the agent's next request would renew it. That renewal is
the side effect. Then the token is sent once to
GET /api/v1/auth/owner/me, because a sign-in ended on the server still looks valid on this machine. - A refusal with a server explanation is shown in its own words. Code-only
refusals use the recovery wording above. Hosted refusals say
rookone auth login, which is the same command asrookone login. This holds after another command found the sign-in ended first, too: the device keeps a note of what the server said and any known session-ending reason. A device reported Lost gets steps to back up and remove the affected agents. On a self-hosted server, ask the administrator to use Revoke on the admin Agents screen. On hosted RookOne, delete the agents from the owner portal's Agents page. A signed-out device getsrookone loginadvice. A person who left gets the administrator-admission next step, detected from either the session note or an agent-cut record for that deployment and organization. A copied sign-in gets the copied-ticket explanation and a sign-in next step. Indoctor --json, these checks include the known reason (lost,person_left,signed_outorcopy_detected) inevidence.reason. Missing or unknown reasons omit that field. Doctor can use a server-provided explanation. An ended session without a recognizable cause gets sign-in advice. For a device reported Lost, the Fix cells andNext:lead withrookone agent backup, followed byrookone deregister <name> --force-local --backup-file <that path>. Review the confirmation because the command also deletes the agent on the server if its key still works. Follow the server-side step above after local removal. - If a renewal result was uncertain and its 45-second retry window has closed,
Doctor sends no renewal request. It reports: "This device's sign-in may have
been renewed elsewhere; run
rookone loginto continue." The saved credentials remain on this machine. - A sign-in lasts at most 90 days from when the person signed in, and renewals do not extend it. Doctor warns 7 days before that limit. It also warns when the sign-in was saved by an older rookone that did not record when the person signed in. A sign-in also lapses after 30 days unused, but any use (doctor included) renews it.
- When more than one account is signed in,
owner.sessionnames the account a backup restore would sign in as. To restore an agent of another account, runrookone account switch <email>first. agent.recoverablewarns but never fails. The agents still work. They could not recover by themselves later. Whenidentity.agentfails,agent.recoverableisnot_run: an agent that cannot load cannot recover by itself either. The cause names each agent's account by its email; the organization id is inevidenceonly.- When the account in use owns none of this device's agents but another signed-in
account does,
account.signed_inwarns and its fix isrookone account switch <email>.rookone loginsays the same after signing in.
An agent that cannot load
With no agent selected, identity.agent loads every agent in this home (no
request is sent) and fails naming each one that does not load. With --as or
ROOKONE_AGENT, it loads that agent. The fix depends on why it does not load,
never on how you selected it:
| Why | Fix |
|---|---|
| Its keys are missing from an accessible encrypted vault, and a backup of it is recorded | rookone agent recover --name <name> --seed-backup <file>: the same number, nothing deleted. |
| Its keys are missing, and no backup is recorded | rookone deregister <name> --force-local, then rookone register --name <name>. The new agent has a new number. |
| The backend confirms the keyring is locked | Unlock the keyring. Nothing is removed. |
| The vault is unavailable, timed out, missing or corrupt | Follow the specific vault error; unlocking is not a general repair. Nothing is removed. |
| This home predates 0.4.17 | Follow the fresh-home recovery steps. |
Agents made by RookOne 0.4.0-0.4.10 stored no working keys, so 0.4.11 and later
cannot load them. Doctor cannot tell such an agent from one whose vault records
were removed, and says so. leaf.bridge probes the bridge with an agent that
loads. When no deployment-bound agent here loads, it is not_run behind
identity.agent.
Local data and vault
For a home initialized in file-key mode, the Vault master key row shows the key file's path and explains that file permissions alone protect it.
For a keyring-backed home, a missing master key can occur after moving the home because the keyring stores the master key under the original path. See the headless Linux guide for the passphrase setup.
Local database schema
localdb.schema refuses revisions below 0024 (the RookOne 0.4.17 baseline)
and existing tables without a migration stamp. Upgrading the client or running
rookone cache stats cannot migrate these stores. Stop RookOne, preserve the
entire old home, and follow the fresh-home recovery steps.
Keep the old database in its old home; a fresh home does not inherit its history.
Supported older revisions, including 0024, still receive the rookone cache stats
migration advice. A database with no tables can be initialized by that command.
Check ids
The checks run in this order.
| id | Row name | What it checks |
|---|---|---|
cli.version | CLI | Installed CLI version and where it runs from. |
install.version_skew | Install | The installed rookone packages (and the plugin) are one release. |
home.resolved | Home | Which RookOne home this run inspects. |
home.moved | Home moved | The home was not moved away from the path its keys and leaf were filed under. |
config.file | Config | config.toml is readable. |
keyring.backend_refused | Keyring backend | No untrusted keyring backend is forced by environment. |
keyring.unavailable | Keyring | The vault master-key provider is available. |
keyring.backend | Agent secret vault | The master-key provider and where it stores the key. |
localdb.encryption | DB encryption | local.db is encrypted and its key opens it. |
localdb.schema | Local data schema | local.db is at a schema revision this install knows. |
membership.held | Held group messages | Counted by sender; run rookone sync to fetch and verify membership. |
credentials.manifests | Credential manifests | Every local agent manifest is readable with safe permissions. |
legacy.bridge_units | Legacy events bridge | No obsolete events-bridge systemd unit is installed. |
identity.agent | Agent | An agent is registered here (and the selected one loads). |
identity.cert | Certificates | No local agent's working-key certificate has lapsed or is about to. |
identity.api_key | API key | The selected agent has its API key stored. |
identity.encryption_key | Encryption key | The selected agent has its X25519 encryption key. |
secrets.vault | Keyring hygiene | The selected agent's secrets load from the vault. |
identity.backup | Root backup | The selected agent has a recorded root backup before forced removal. |
cert.renewal | Certificate renewal | The selected agent's certificate renewal reached the deployment. |
account.signed_in | Account | This machine is signed in to the owner account its agents use. |
owner.session | Owner sign-in | This machine's sign-in for the account in use is live on the server. |
agent.recoverable | Recovery | Each hosted agent could recover unattended (a person is signed in for its organization). |
server.api_url | API URL | Which deployment URL the selected agent talks to. |
server.client_version | Client minimum | The installed client meets the minimum in the verified deployment identity. Below the floor: run rookone upgrade. |
server.reachable | Connectivity | The deployment answers its liveness route. |
server.ready | Readiness | A self-hosted server reports itself ready (its /readyz). |
server.jwt | JWT Service | The deployment exchanges the API key for a token (informational). |
server.api_key | Identity | The deployment accepts the selected agent's API key. |
server.agent_admitted | Admission | The deployment admits the agent (not suspended, revoked or unpaid). |
keys.lookup | Key lookup | The deployment serves this agent's certified keys. |
keys.signing | Signing key | The deployment holds this machine's signing key. |
leaf.running | leaf-nats-reachable | A local leaf NATS server listens on this home's port. Skipped, without connecting, when no agents are registered here. |
leaf.owner | Leaf owner | That leaf belongs to this home, not another RookOne home. |
leaf.stream | rookone-local-stream | The rookone-local stream exists with the expected subjects. |
leaf.bridge | leaf-cloud bridge | The leaf is bridged to the deployment and its sources deliver. |
delivery.uncarried | Uncarried agents | The leaf carries every hosted agent and the server tenant it serves; an agent it cannot carry receives nothing. |
agent.cut | Cut agents | No agent here was cut off by its deployment (admin revoke, Lost, its person left); each is named by its name and number, and Next: leads with its removal. |
agent.rotation_unsaved | Credential save | Every agent credential the server rotated was saved to the keyring here. |
mirror.running | inbox-mirror process | The inbox mirror runs for the agents registered here. |
ingest.local | inbox-mirror heartbeat | The mirror's heartbeat is fresh (messages land in local.db). |
mirror.consumer | inbox-mirror consumers | Every agent the mirror serves has its drain consumer in NATS. |
mirror.ack_progress | inbox-mirror ack progress | Drain consumers are caught up. |
mirror.redelivery | inbox-mirror redelivery | Drain consumers are not redelivering in a loop. |
mirror.sources_match | mirror sources vs agents | Each link's named sources match its credentials. |
mirror.sources_active | mirror sources active | Configured cross-domain sources are active. |
process.stale | Processes | No RookOne process for this home predates the installed version. The plain screen shows it only when a running mirror or channel runs older code than the installed client: a mirror says which version it imported, while a channel or MCP server that started before the install counts as older. |
channel.registered | Agent hosts | Claude Code and Codex are wired to RookOne's MCP server. |
plugin.installed | Plugin | The rookone-channel plugin is on PATH. |
The leaf is the one receive path. delivery.uncarried fails for each hosted agent
here that the leaf cannot carry: past this machine's source limit (64 per link,
two links), its residency limit or the organization's source capacity, of an
organization with no leaf credential here, or of a second deployment. It also names
an agent of a second tenant of the same server. An uncarried agent receives no
messages from other machines; they wait on the server (up to 7 days on hosted).
Keep each server tenant in its own home:
ROOKONE_HOME=~/.rookone-<tenant> rookone login --deployment <id>, then register
the agent there. Several hosted organizations can share one home. The row names
each agent with its reason and fix. For the three limits there is no fix yet
beyond deregistering agents you no longer use.
agent.cut fails for each agent its self-hosted server cut off: an admin revoked it, its device
was marked Lost, or its person left the company. If the server supplies no usable
cause, Doctor says the cause is unknown. This machine stops asking for the agent:
its inbox mirror stops, and its next renewal attempt waits an exponential back-off
(one minute, doubling to an hour). The other agents on the machine keep their
uplink. Only a Lost mark can be undone: if the device was marked Lost by mistake,
run rookone login and use the agent again, and its root sign-in restores it.
Otherwise the fix is to remove its local copy, after a backup:
rookone agent backup --name <agent> --out <path off this machine>, then
rookone deregister <agent> --force-local --yes --backup-file <that path>. A recorded
cut sends no request; only a refusal of the agent's key removes this machine's copy, and
the server's copy stays until an administrator revokes it with the Revoke button on the admin Agents screen.
Without the current backup file the keys are kept.
agent.rotation_unsaved fails when the self-hosted server rotated an agent's credential (each
renewal does, so the server can tell a copy from the original) and the keyring here
could not save the new one. Only the process that renewed holds the new credential;
the other processes on this machine hold the old one, which the server accepts for 60
seconds and then treats as a copy: it cuts the agent. Fix the keyring and do not
restart RookOne until the row is green: the process holding the new credential saves
it at its next renewal, and a restart would load the old one. The client first checks
that the keyring takes writes and does not rotate when it does not, so this needs the
keyring to fail between that check and the save.
The hosted service refuses a client older than its floor (the service's
ROOKONE_CLIENT_MIN_VERSION setting; the client has none of its own) with HTTP 426
client_upgrade_required, "This RookOne client is too old. Upgrade with: rookone
upgrade", and doctor's fix is rookone upgrade.
The release acceptance suite
Every client release runs doctor against broken and healthy homes using the
installed wheels, not the source tree:
uv sync --all-packages --all-extras --frozen
uv run --no-sync --package rookone pytest packages/cli/tests/acceptance -m doctor_acceptance -vThe suite builds the five wheels into a fresh Python 3.12 environment, gives
each case its own ROOKONE_HOME, keyring and ports, and checks that every case
reports the expected id, status and fix.
Per-agent probes and sessions
Without an agent selector, the plain report shows Identity, Local ingest, and
Cloud bridge rows for each registered agent. A missing key fails that agent's
Identity row; its dependent required probes are not_run. Healthy agents keep their own
results. Delivery readiness comes from a fresh mirror heartbeat; Cloud bridge
also checks the local leaf's connection and named sources. This is a readiness
probe, not an end-to-end message delivery test. If named sources cannot be verified,
the repair is rookone start --background --as <name> for the affected agent.
The verbose report prints these rows beneath their corresponding checks. JSON
keeps the stable check IDs and includes the rows in evidence.probes, with
agent, probe, status (ok, warn, fail, not_run, or skip), detail, and fix.
A failed agent probe makes its parent check fail and doctor exit non-zero. The
parent names the affected agent and its fix; healthy agents keep their passing
rows. Required probes that could not be measured are not_run and exit non-zero.
A cloud probe for a local-only agent is inapplicable: it remains skip and does
not fail the run. If Linux /proc log inspection is unavailable, the optional
process probe reports "not checked", rather than claiming the process is healthy.
If root or working keys are gone, a new backup cannot recreate them. Restore an existing backup if you have one; otherwise remove the agent and register again. Doctor can see the recorded backup date, but cannot know whether you kept that file elsewhere. A missing API key alone does not prevent backing up the identity.
On Linux, doctor detects a process for this home holding a deleted log file and
asks you to restart your sessions. Deleting channel.log while a session runs
leaves its old file descriptor open. For stamped sessions and mirrors, doctor
compares their running package versions with the installed version; a
same-version reinstall is not an upgrade. Older unstamped sessions may report
that they predate the install, but doctor cannot claim they run older code.