Skip to content

Operations

apply converges the host to agents.yaml and restarts exactly what changed. Run it after editing agents.yaml, after apt upgrade agentctl, or to heal drift.

agentctl apply                # the whole host
agentctl apply noor           # one agent
agentctl apply --dry-run      # print the plan, change nothing

apply semantics

Reconcilers render the desired output and write only on a diff, and the restart tail bounces only the agents whose inputs moved. A second apply on an unchanged host writes nothing and restarts nothing. Two steps still run unconditionally: the pull from the GitOps origin, and the nft -f re-assert of the port guard.

An agent restarts when its fingerprint moved this run: payload/version, ledger entry, overlay hash, secrets. Two cascades restart an agent whose own fingerprint did not move:

cascade who restarts
a gateway bounced this run the local agents paired with it — teams/slack by channel, webview by user_email
the PII custom-entity automaton was rebuilt every pi agent on the host
flag effect
(none) reconcile deltas, re-render env/hooks/crons, skip unchanged agents by fingerprint, restart what changed
--force reconcile AND restart every agent and gateway regardless of fingerprint (full base-unit refresh)
--dry-run print the plan, including the changed → will restart after converge list, and apply nothing
--no-pull skip the pull from the GitOps origin
--prune list agents live on the host but no longer in the ledger (orphans). Needs a whole-host run — ignored when a single agent is named
--prune --yes tear those orphans down: userdel -r plus unit/timer/socket cleanup. Destructive
--json stream the run as NDJSON progress events — one object per line, phase/step_start/step/log/progress/done/error — instead of the human progress bar
--verbose more detail per step
[<agent>] scope the run to one agent. A selector the ledger pins to another host is forwarded to that host

agentctl apply logs tails the reconcile that is currently running.

A deb-version bump moves every fingerprint and force-bounces the gateways, so a plain apply after an upgrade reconciles and bounces the whole host on its own.

Host templates propagate to their instances

apply runs a host pass and then a per-agent pass, and each pass gates restarts on its own changed files. A record of the host-role destinations changed earlier in the same run carries into the per-agent pass, scoped to that one process.

browser@<agent> declares five restart inputs: the host template, the private-display drop-in, the shared-display drop-in, the agent's display env, and /etc/agentctl/env/chrome-proxy.env.

case result
a shared @ template changes during the run every instance restarts on the new command line
apply is interrupted between the host pass and the agent pass instances stay on the old command line; apply --force restarts them regardless of fingerprint
agentctl converge <agent> runs no host pass, so it inherits no record

When an apply leaves something broken

agentctl doctor [<name>] is the first stop and agentctl logs <name> [-f] is the second. The whole ladder — what each finding means, the raw systemd unit, a host-wide failed-unit sweep, journal reads for non-agent units, and cross-host reach — is Troubleshooting.