From 279f97e5ca438408032d1200aa0c12b484d8d0a6 Mon Sep 17 00:00:00 2001 From: atlas Date: Thu, 26 Nov 2026 15:40:29 +0100 Subject: [PATCH] swarmctl: drop the controller socket target, the host has no socket to reach --- docs/2-handbook/swarm/swarmctl-cli.md | 132 ++---------- swarmctl/Cargo.toml | 5 +- swarmctl/README.md | 4 +- swarmctl/src/agent.rs | 111 ++-------- swarmctl/src/agents_md.rs | 6 +- swarmctl/src/forge.rs | 9 +- swarmctl/src/inference.rs | 8 +- swarmctl/src/interactive.rs | 2 +- swarmctl/src/main.rs | 293 ++++++-------------------- swarmctl/src/permissions.rs | 12 +- swarmctl/src/remote.rs | 8 - swarmctl/src/schedule.rs | 12 +- swarmctl/src/setup.rs | 17 +- swarmctl/src/terminal.rs | 8 +- swarmctl/src/watch.rs | 146 +++++-------- 15 files changed, 174 insertions(+), 599 deletions(-) diff --git a/docs/2-handbook/swarm/swarmctl-cli.md b/docs/2-handbook/swarm/swarmctl-cli.md index a1c9e1419..1e7d3fd85 100644 --- a/docs/2-handbook/swarm/swarmctl-cli.md +++ b/docs/2-handbook/swarm/swarmctl-cli.md @@ -66,7 +66,7 @@ swarm-level operator CLI * `--users-file ` — Host-side path of authelia's users database — that is, the path inside the container, prefixed with the container's root. This is the only user store: it's read before every change and written in place, and `swarm-authelia-bridge` writes the same file. -* `--swarm ` — The swarm's domain, as `https://` or the bare domain. Given, the `agent`, `schedule` and `forge` verbs, and the agent checks and steps of `setup`, go through its gateway as the account `swarmctl login` logged in, instead of over the controller's socket. Falls back to `SWARMCTL_SWARM`; `login` then falls back to `SWARMCTL_LOGIN_DEFAULT_SWARM`. The swarm-controller nix module sets both to its host's own swarm, so there the verbs use the gateway and need `swarmctl login` once. With no swarm, they use the socket that `--controller-socket` or `SWARM_CONTROLLER_SOCKET` names; the module sets neither +* `--swarm ` — The swarm's domain, as `https://` or the bare domain. Given, the `agent`, `schedule` and `forge` verbs, and the agent checks and steps of `setup`, go through its gateway as the account `swarmctl login` logged in. Falls back to `SWARMCTL_SWARM`; `login` then falls back to `SWARMCTL_LOGIN_DEFAULT_SWARM`. The swarm-controller nix module sets both to its host's own swarm, so there the verbs use the gateway and need `swarmctl login` once. The controller runs as a pod and has no socket on the host, so a verb that reaches it needs a swarm * `--ca-file ` — A PEM CA certificate to trust beside the system roots, for a swarm whose gateway serves a certificate from the swarm's own CA. Falls back to `SWARMCTL_CA_FILE` @@ -115,9 +115,6 @@ No approval gate guards this: the caller is root on the controller's host, or lo * `--agents-md ` — A text file the agent's `AGENTS.md` starts with. The agent writes it on its first start, and only when it has no `AGENTS.md` yet: re-creating an agent never replaces an existing file. The controller refuses a file over 64 KiB. -* `--controller-socket ` — swarm-controller's unix socket. - - Used when `--swarm` and `SWARMCTL_SWARM` give no swarm; falls back to `SWARM_CONTROLLER_SOCKET`. The controller runs as a pod and has no socket on the host, so name the swarm instead. @@ -129,18 +126,12 @@ swarm-controller does this for every agent with a store identity at start and ev Queues and returns, the same way `agent create` does — watch the swarm UI's job view for the outcome. -**Usage:** `swarmctl agent mint-forge-token [OPTIONS] ` +**Usage:** `swarmctl agent mint-forge-token ` ###### **Arguments:** * `` — Name of an agent that already exists -###### **Options:** - -* `--controller-socket ` — swarm-controller's unix socket. - - Used when `--swarm` and `SWARMCTL_SWARM` give no swarm; falls back to `SWARM_CONTROLLER_SOCKET`. The controller runs as a pod and has no socket on the host, so name the swarm instead. - ## `swarmctl agent set-state` @@ -164,9 +155,6 @@ No approval gate guards this: the caller is root on the controller's host, or lo * `--hive ` — The hive that runs the agent * `--yes` — Confirm `destroyed`, which can't be undone -* `--controller-socket ` — swarm-controller's unix socket. - - Used when `--swarm` and `SWARMCTL_SWARM` give no swarm; falls back to `SWARM_CONTROLLER_SOCKET`. The controller runs as a pod and has no socket on the host, so name the swarm instead. @@ -176,18 +164,12 @@ Follow an agent's terminal rows live: the newest retained rows, then each new on The swarm-level counterpart of `hivectl agent watch`, read from the swarm-controller rather than from the agent's own web UI, so it works from any machine with `--swarm` and doesn't need the agent running to show what it last did. Fails when the swarm has never heard from the agent. -**Usage:** `swarmctl agent watch [OPTIONS] ` +**Usage:** `swarmctl agent watch ` ###### **Arguments:** * `` — Agent name -###### **Options:** - -* `--controller-socket ` — swarm-controller's unix socket. - - Used when `--swarm` and `SWARMCTL_SWARM` give no swarm; falls back to `SWARM_CONTROLLER_SOCKET`. The controller runs as a pod and has no socket on the host, so name the swarm instead. - ## `swarmctl agent inference` @@ -212,18 +194,12 @@ A field the swarm sets wins over the agent's own value (its agent.nix or a `hype Show what the swarm sets for an agent, naming the fields it doesn't set, and the model and effort the agent runs on, each with where it comes from -**Usage:** `swarmctl agent inference get [OPTIONS] ` +**Usage:** `swarmctl agent inference get ` ###### **Arguments:** * `` — Agent name -###### **Options:** - -* `--controller-socket ` — swarm-controller's unix socket. - - Used when `--swarm` and `SWARMCTL_SWARM` give no swarm; falls back to `SWARM_CONTROLLER_SOCKET`. The controller runs as a pod and has no socket on the host, so name the swarm instead. - ## `swarmctl agent inference set` @@ -244,9 +220,6 @@ Set fields for an agent. Only the flags given change; the others keep what's sto Possible values: `low`, `medium`, `high`, `xhigh`, `max` * `--subagent-models ` — The models it may start subagents on, comma-separated. Stored and shown; the agent doesn't apply it yet -* `--controller-socket ` — swarm-controller's unix socket. - - Used when `--swarm` and `SWARMCTL_SWARM` give no swarm; falls back to `SWARM_CONTROLLER_SOCKET`. The controller runs as a pod and has no socket on the host, so name the swarm instead. @@ -254,18 +227,12 @@ Set fields for an agent. Only the flags given change; the others keep what's sto Clear every field for an agent, so it goes back to its own values -**Usage:** `swarmctl agent inference clear [OPTIONS] ` +**Usage:** `swarmctl agent inference clear ` ###### **Arguments:** * `` — Agent name -###### **Options:** - -* `--controller-socket ` — swarm-controller's unix socket. - - Used when `--swarm` and `SWARMCTL_SWARM` give no swarm; falls back to `SWARM_CONTROLLER_SOCKET`. The controller runs as a pod and has no socket on the host, so name the swarm instead. - ## `swarmctl agent permissions` @@ -288,18 +255,12 @@ The agent applies its tool permissions at its next turn; the hive running it res Show the permissions the swarm grants an agent, or that it sets none -**Usage:** `swarmctl agent permissions get [OPTIONS] ` +**Usage:** `swarmctl agent permissions get ` ###### **Arguments:** * `` — Agent name -###### **Options:** - -* `--controller-socket ` — swarm-controller's unix socket. - - Used when `--swarm` and `SWARMCTL_SWARM` give no swarm; falls back to `SWARM_CONTROLLER_SOCKET`. The controller runs as a pod and has no socket on the host, so name the swarm instead. - ## `swarmctl agent permissions set` @@ -319,9 +280,6 @@ Replace the permissions the swarm grants an agent; the internet flag stays unles Possible values: `true`, `false` -* `--controller-socket ` — swarm-controller's unix socket. - - Used when `--swarm` and `SWARMCTL_SWARM` give no swarm; falls back to `SWARM_CONTROLLER_SOCKET`. The controller runs as a pod and has no socket on the host, so name the swarm instead. @@ -329,18 +287,12 @@ Replace the permissions the swarm grants an agent; the internet flag stays unles Clear the agent's permissions, so the default applies again -**Usage:** `swarmctl agent permissions clear [OPTIONS] ` +**Usage:** `swarmctl agent permissions clear ` ###### **Arguments:** * `` — Agent name -###### **Options:** - -* `--controller-socket ` — swarm-controller's unix socket. - - Used when `--swarm` and `SWARMCTL_SWARM` give no swarm; falls back to `SWARM_CONTROLLER_SOCKET`. The controller runs as a pod and has no socket on the host, so name the swarm instead. - ## `swarmctl agent agents-md` @@ -362,18 +314,12 @@ Show an agent's AGENTS.md, or edit it with a diff. Print an agent's AGENTS.md on stdout, and its revision on stderr -**Usage:** `swarmctl agent agents-md get [OPTIONS] ` +**Usage:** `swarmctl agent agents-md get ` ###### **Arguments:** * `` — Agent name -###### **Options:** - -* `--controller-socket ` — swarm-controller's unix socket. - - Used when `--swarm` and `SWARMCTL_SWARM` give no swarm; falls back to `SWARM_CONTROLLER_SOCKET`. The controller runs as a pod and has no socket on the host, so name the swarm instead. - ## `swarmctl agent agents-md apply` @@ -382,7 +328,7 @@ Apply a unified diff to an agent's AGENTS.md. The diff names `a/AGENTS.md` and `b/AGENTS.md`, as `diff -u a/AGENTS.md b/AGENTS.md` writes it. The agent refuses it when the file is no longer at `--base`, or when it doesn't apply, and leaves the file as it was. -**Usage:** `swarmctl agent agents-md apply [OPTIONS] --base ` +**Usage:** `swarmctl agent agents-md apply --base ` ###### **Arguments:** @@ -392,9 +338,6 @@ The diff names `a/AGENTS.md` and `b/AGENTS.md`, as `diff -u a/AGENTS.md b/AGENTS ###### **Options:** * `--base ` — The revision you made the diff against, as `get` printed it. It's the git blob id of that text, so `git hash-object` of the unedited file prints it too -* `--controller-socket ` — swarm-controller's unix socket. - - Used when `--swarm` and `SWARMCTL_SWARM` give no swarm; falls back to `SWARM_CONTROLLER_SOCKET`. The controller runs as a pod and has no socket on the host, so name the swarm instead. @@ -433,9 +376,6 @@ Without `--every` it fires once. Without `--at` its first fire is now. * `--at