Diagnostics for channels + sessions.

Task counts and audit totals use a read-only metadata summary. Retained task payloads and delivery history are not loaded for each status request, and overlapping requests share the pending summary read. Database work runs on the shared SQLite worker; live task ownership is still checked by the Gateway. These summaries are not a full physical database-integrity check. Full registry restoration and Doctor retain their integrity verification.

apus status
apus status --all
apus status --deep
apus status --usage
apus status --all --usage
apus status --usage --agent work
Flag Description
--all Full diagnosis (read-only, pasteable). Includes security audit, plugin compatibility, and memory-vector checks.
--deep Requests channel health (live checks where supported). Also enables the security audit.
--usage Prints normalized provider usage windows as X% left.
--agent <id> Selects the agent auth/profile scope for --usage. Required when an explicit multi-agent fleet has no default.
--json Machine-readable output.
--timeout <ms> Check timeout in milliseconds (default: 60000).
--verbose / --debug Also print the raw Gateway target resolution before the report.

Status starts one monotonic check deadline when the command begins. Local readiness, Gateway status, provider usage, and deep health consume the remaining allowance. Remote targets and explicit Gateway URLs skip local readiness but keep the same deadline. Local checks report the observed startup phase while waiting. If the Gateway is still starting when the budget expires, status reports “still starting” instead of unreachable and skips deep channel checks. JSON keeps the status report and adds gateway.readiness: "still-starting" and gateway.startupPhase. An explicit --timeout limits that shared allowance.

When no matching Gateway service or live foreground owner exists and its port is free, status checks directly instead of waiting for a Gateway startup. Local-only agent environments therefore report an unavailable Gateway promptly. Observed startup migrations retain startup grace across the handoff to Gateway ownership; unverifiable ownership also retains that grace. Lock and native process inspection consume the same remaining check allowance.

Channels without a check, such as WhatsApp, report lifecycle health instead. In the Health table, healthy is OK; degraded lifecycle states and failed checks remain WARN. A lifecycle OK does not mean a live check ran.

The Update run row preserves the last recorded update outcome. When the local Gateway passes the current readiness and connection checks and its serving version matches the recorded update target, a previous failure is labeled as historical: Last update run failed (post-update-failed) — Gateway is serving 2026.9.7; run apus update to clear the record. Build IDs must also match when both the target and the live check expose them. A healthy old version, a different build, or unknown identity keeps the warning and its recorded failure details, with the serving and target versions when known. Rollback and recovery observations cannot by themselves establish the intended candidate identity. A same-version rollback stays warned when the intended candidate build cannot be verified. A failed run that never selected a target, such as a preflight refusal that recorded no target version, SHA, tag, or post-update identity, is also labeled as historical once the Gateway serves a different version or build than the running Gateway observation saved with that failure: Last update run failed (preflight-no-good-commit) — Gateway is now serving 2026.10.1; recorded serving identity was 2026.9.4. The installed package identity alone cannot establish this change: it may already have been ahead of the running Gateway when the update failed. A recovery check matching the old installed package does not establish an update target. Without a saved serving identity, the warning remains. A run with an explicit target keeps the rules above. Status does not rewrite the failed run or claim the update succeeded. Starting, unreachable, degraded, and remote Gateways do not qualify for this note. Use apus update status to inspect the saved verification failure.

--deep also asks the running Gateway whether the Node executable it still holds can be started. A Homebrew upgrade can delete that Cellar path while the LaunchAgent plist still points at a valid symlink and the Gateway port stays reachable. Status then warns:

Gateway runtime is stale after Node upgrade: child workers are using <path>, which no longer exists. Restart the Gateway.

The check does not restart the Gateway. Run apus gateway restart after the warning. Exec and stdio MCP command relays can use the stable Homebrew Node path when the old executable is gone. Workers that require the Gateway's exact runtime still need a restart; a failed supervisor or broker launch reports the same warning.

--deep and --all also show delivery queue warnings for dead-lettered messages and pressured inbound lanes. These warnings include pending, claimed, and blocked message counts even when a channel connection is healthy. See Queue warnings.

Plain apus status stays on the fast read-only path and marks memory as not checked instead of unavailable when it skips memory inspection. Heavy security audit, plugin compatibility, and memory-vector checks are left to apus status --all, apus status --deep, apus security audit, and apus memory status --deep.

Local agent ownership checks read schema and owner metadata from one consistent SQLite snapshot, including committed WAL changes. They do not copy the entire agent database unless its journal state requires private recovery. Startup and migration readiness checks retain their full validation.

The CLI runs in a separate process and contacts the Gateway over WebSocket, even for a local loopback target. --timeout bounds checks, not the entire status command. Cold device-token worker initialization happens during request preparation, before the RPC timeout starts; connection token reads remain fresh. Compare apus gateway call status --json with apus status --json to separate the Gateway response from local report collection. Gateway Prometheus RPC timings exclude CLI startup and connection setup; a slow CLI can finish without a slow Gateway handler.

When the Gateway is reachable and authorized, status --json uses its status projection instead of scanning every agent's plugin metadata and database ownership locally. The Gateway supplies session counts, heartbeat and task state, runtime vitals, and agent roster facts. The request keeps operator.read scope, including its redaction of session paths, recent sessions, model defaults, and detailed admission refusals. After the Gateway hydrates a physical session store, clean repeated status reads reuse its resident materialized session rows; only topology changes and dirty or missing exact identities return to the existing read-only SQLite path.

JSON collection.notCollected names fields that were not inspected and explains why. Online status leaves workspace and bootstrap checks unknown, including agents.bootstrapPendingCount: null. It returns channelSummary: [] without loading channel plugins and records channelSummary in collection.notCollected. An empty list there means the field was not collected, not that no channels are configured. Use apus channels status for the configured inventory, or apus channels status --probe for live account checks. Online status skips local config validation, channel and memory credential inspection, and the local plugin inspections normally requested by --all or --deep. Requested security audit and plugin compatibility sections report collected: false; memory remains null. Use apus security audit, apus plugins inspect --all, or apus memory status --deep for those local inspections. --deep still requests Gateway health, and --usage --agent <id> retains its credential scope. When the Gateway is unavailable, JSON status retains local diagnostics.

For Git installs, plain status compares cached remote-tracking refs without a network fetch. If the latest recorded update fetch failed and no later update run records a completed fetch, the Update row shows update check stale: last update fetch failed 5m ago (network error) instead of up to date, with ahead/behind counts labeled cached. JSON exposes this under update.git.stale (reason, failedAtMs, detail, and runId) and sets update.git.countsCached to true. Without a recorded fetch failure, the usual cached comparison is unchanged. The history belongs to the current state directory. A later run that completes its fetch clears the warning even if the rest of that update is skipped, fails, or rolls back. A manual git fetch does not clear the recorded warning. Use apus update status for a fresh check and the last update run, or run apus update again. apus status --deep also fetches for that check; it does not change the ledger. See Release channels.

Status timing

Use the existing diagnostic timeline to locate time spent outside Gateway RPCs:

APUS_DIAGNOSTICS=timeline \
APUS_DIAGNOSTICS_TIMELINE_PATH=/tmp/apus-status-timeline.jsonl \
  apus status --json

The timeline includes configuration and secret resolution, agent admission, local session reads, Gateway checks, and summary collection. Durations include waiting; parallel stages overlap and should not be added together.

Skills diagnosis

status --all reports eligible skills and skills with missing prerequisites for the workspace shown in the Skills row. Missing prerequisites use the same category as apus skills check: intentionally disabled skills and skills blocked by the bundled allowlist are excluded; agent allowlist exclusions remain independent. Unmet OS requirements are included in this count, although Doctor does not disable skills for OS incompatibility. Use apus skills check --agent <id> to inspect the missing requirements.

Session and model resolution

Usage and quota

Overview and update status

The Gateway service row compares its installed package with the active CLI. If they resolve to different installations, status names both package paths and versions. It recommends apus doctor --fix or apus gateway install --force when service installation is allowed, or reports the installation owner's refusal. This local diagnostic remains available when the Gateway connection fails, including a protocol mismatch. JSON exposes the comparison as gatewayService.installationDrift. If local session state requires Doctor, status prints any installation drift to stderr alongside the original error and preserves the failure exit status.

Secrets

Memory

status --json --all reports memory details from the active memory plugin runtime selected by plugins.slots.memory. Custom memory plugins can leave built-in memory.search.enabled disabled and still report their own files, chunks, vector, and FTS state.

Related