Skip to content

Open-source AI teammates in Slack, Teams, Discord, Telegram and Mattermost. Self-host it, with any agent harness and any model.

A controller Switch Console runs on an SSH host is not told a release (#870)

Louis Amaudruzc37050e03019
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 002b434c2..b0910474f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -99,6 +99,13 @@ version of their own to them without also giving them a release of their own.
could not tell where the image would be loaded from.
#### Fixed
+- **A controller Switch Console runs on an SSH host is no longer shown as behind.**
+ It enrolls like a standalone controller, so Core named it the release and the
+ Machines page marked it behind, though it runs Console's bundle and cannot
+ follow Core. Console now starts it with `--updated-by-console`; it follows no
+ release, reports `controller.updated_by: "console"` in its status, and Core
+ names it none, as for Console's own controller. One started from an older
+ Console bundle shows behind until Console replaces that bundle.
- **Usage telemetry no longer carries the `ENVIRONMENT` or `SERVICE_NAME`
settings.** From 0.28.0 through 0.30.0, with `TELEMETRY_ENABLED=true`, every
event sent to the Flint relay carried both, as `deployment.environment`,
diff --git a/console/apps/switch-console-desktop/src/main/core/host-controllers/host-scripts.test.ts b/console/apps/switch-console-desktop/src/main/core/host-controllers/host-scripts.test.ts
index 54d1b59a4..e7f6f4eca 100644
--- a/console/apps/switch-console-desktop/src/main/core/host-controllers/host-scripts.test.ts
+++ b/console/apps/switch-console-desktop/src/main/core/host-controllers/host-scripts.test.ts
@@ -40,6 +40,7 @@ const dataDir = flag('--data-dir');
const mode = fs.readFileSync(path.join(dataDir, 'mode'), 'utf8').trim();
const runs = path.join(dataDir, 'runs');
fs.appendFileSync(runs, 'run\n');
+fs.writeFileSync(path.join(dataDir, 'last-args'), rest.join(' '));
if (mode === 'revoked') process.exit(3);
if (mode === 'fail-once' && fs.readFileSync(runs, 'utf8').split('\n').filter(Boolean).length === 1) process.exit(1);
process.on('SIGTERM', () => process.exit(0));
@@ -192,6 +193,9 @@ describe('the detached supervisor', () => {
await start('up');
await until(async () => (await status()).running, 5_000);
const supervisor = startedPids.at(-1)!;
+ // Console updates it, by replacing its bundle; it follows no release Switch names.
+ await until(async () => existsSync(join(dataDir(), 'last-args')), 5_000);
+ expect(readFileSync(join(dataDir(), 'last-args'), 'utf8')).toContain('--updated-by-console');
mkdirSync(join(dataDir(), 'watchers', 'agent-1'), { recursive: true });
writeFileSync(join(dataDir(), 'controller.db'), '');
mkdirSync(join(dataDir(), 'secrets'), { recursive: true });
@@ -282,7 +286,7 @@ describe('the systemd unit', () => {
path: '/home/ada/.local/bin:/usr/bin',
});
expect(unit).toContain(
- 'ExecStart="/usr/bin/node" "/home/ada/.local/state/switch/sdk-host/agent-controller-x.mjs" "run" "--data-dir" "/home/ada/.local/state/switch/agent-controller/console-server-1" "--shared-host-bundle" "/home/ada/.local/state/switch/sdk-host/shared-host-y.mjs"'
+ 'ExecStart="/usr/bin/node" "/home/ada/.local/state/switch/sdk-host/agent-controller-x.mjs" "run" "--data-dir" "/home/ada/.local/state/switch/agent-controller/console-server-1" "--shared-host-bundle" "/home/ada/.local/state/switch/sdk-host/shared-host-y.mjs" "--updated-by-console"'
);
expect(unit).toContain('Environment="PATH=/home/ada/.local/bin:/usr/bin"');
expect(unit).toContain('Restart=on-failure');
diff --git a/console/apps/switch-console-desktop/src/main/core/host-controllers/host-scripts.ts b/console/apps/switch-console-desktop/src/main/core/host-controllers/host-scripts.ts
index 2a2e6386f..408de01b3 100644
--- a/console/apps/switch-console-desktop/src/main/core/host-controllers/host-scripts.ts
+++ b/console/apps/switch-console-desktop/src/main/core/host-controllers/host-scripts.ts
@@ -128,7 +128,7 @@ process.on('SIGTERM', () => { stopping = true; if (child) child.kill('SIGTERM');
const start = () => {
const started = Date.now();
record({ state: 'running', since: new Date(started).toISOString() });
- child = cp.spawn(o.node, [expand(o.bundle), 'run', '--data-dir', dataDir, '--shared-host-bundle', expand(o.sharedHost)], {
+ child = cp.spawn(o.node, [expand(o.bundle), 'run', '--data-dir', dataDir, '--shared-host-bundle', expand(o.sharedHost), '--updated-by-console'], {
stdio: 'inherit',
env: Object.assign({}, process.env, { PATH: o.path || process.env.PATH, SWITCH_CONTROLLER_LOG_LEVEL: 'info' }),
});
@@ -272,7 +272,11 @@ if (o.wipe) {
console.log(JSON.stringify({ turnedOff: turnedOff }));
`;
-/** The systemd user unit that runs the controller, restarted only on exit code 1. */
+/**
+ * The systemd user unit that runs the controller, restarted only on exit code
+ * 1. `--updated-by-console`: Console replaces its bundle, so it follows no
+ * release Switch names and tells Switch so.
+ */
export function systemdUnit(input: {
description: string;
node: string;
@@ -289,7 +293,7 @@ export function systemdUnit(input: {
'Wants=network-online.target',
'',
'[Service]',
- `ExecStart=${[input.node, input.bundle, 'run', '--data-dir', input.dataDir, '--shared-host-bundle', input.sharedHost].map(quote).join(' ')}`,
+ `ExecStart=${[input.node, input.bundle, 'run', '--data-dir', input.dataDir, '--shared-host-bundle', input.sharedHost, '--updated-by-console'].map(quote).join(' ')}`,
`Environment=${quote(`PATH=${input.path}`)}`,
'Environment=SWITCH_CONTROLLER_LOG_LEVEL=info',
'Restart=on-failure',
diff --git a/console/packages/agent-controller/README.md b/console/packages/agent-controller/README.md
index 103843802..789f5cf25 100644
--- a/console/packages/agent-controller/README.md
+++ b/console/packages/agent-controller/README.md
@@ -371,8 +371,11 @@ A failed attempt is reported (`update: {"target", "state": "failed", "problem"}`
and logged, and the same release is not tried again for an hour; the last
attempt is kept in the data directory, so a restart does not retry it either.
Absent or null, `controller_release` leaves the controller alone; one that cannot
-be read is logged and treated as absent. Switch Console's own controller (run
-with `--credential-stdin`) never updates itself: it updates with Console.
+be read is logged and treated as absent. A controller Switch Console runs never
+updates itself: its own (run with `--credential-stdin`) and one it starts on an
+SSH host (run with `--updated-by-console`) update when Console replaces their
+bundle. Each reports `controller.updated_by: "console"` in its status (`"self"`
+otherwise), and Switch names it no release.
Where it installs depends on how the controller was installed:
diff --git a/console/packages/agent-controller/src/api.test.ts b/console/packages/agent-controller/src/api.test.ts
index 5971332e8..ab2889594 100644
--- a/console/packages/agent-controller/src/api.test.ts
+++ b/console/packages/agent-controller/src/api.test.ts
@@ -381,7 +381,12 @@ function statusReport() {
return {
seq: 1,
observed_at: new Date().toISOString(),
- controller: { version: '0.1.0', protocol: 2 as const, assignment_revision: 0 },
+ controller: {
+ version: '0.1.0',
+ protocol: 2 as const,
+ assignment_revision: 0,
+ updated_by: 'self' as const,
+ },
machine: {
platform: { os: 'linux', arch: 'x64', os_version: '6.1' },
disk_free_bytes: 1,
diff --git a/console/packages/agent-controller/src/controller.test.ts b/console/packages/agent-controller/src/controller.test.ts
index d7cde0795..013ded82a 100644
--- a/console/packages/agent-controller/src/controller.test.ts
+++ b/console/packages/agent-controller/src/controller.test.ts
@@ -83,6 +83,7 @@ function deps(server = core.url): ControllerDeps {
dataDir: dir,
workspacesFor: () => join(dir, 'workspaces'),
version: '0.1.0',
+ updatedBy: 'self',
selfUpdate: null,
now: Date.now,
random: () => 0,
diff --git a/console/packages/agent-controller/src/controller.ts b/console/packages/agent-controller/src/controller.ts
index e3660e9dc..fa53c7d1b 100644
--- a/console/packages/agent-controller/src/controller.ts
+++ b/console/packages/agent-controller/src/controller.ts
@@ -25,6 +25,7 @@ import {
type StatusReport,
statusReportSchema,
type ToolStatus,
+ type UpdatedBy,
} from './schemas';
import { type GivenLogin, registerSealingKey, SealedLogins, sealingKeys } from './sealed-logins';
import { CONTROLLER_CREDENTIAL, type SecretStore } from './secrets';
@@ -98,10 +99,11 @@ export type ControllerDeps = {
/** Where agents' working directories go when their definition names none, for a server. */
workspacesFor: (server: string) => string;
version: string;
+ /** Who moves it onto another release, as its status reports to Switch. */
+ updatedBy: UpdatedBy;
/**
- * Follows the release Switch names for this controller; null where the
- * controller is updated some other way (Switch Console's own, which
- * updates with Console).
+ * Follows the release Switch names for this controller; null where Switch
+ * Console updates it instead.
*/
selfUpdate: SelfUpdater | null;
now: () => number;
@@ -412,6 +414,7 @@ export async function runController(
dataDir: deps.dataDir,
workspacesDir: workspaces,
version: deps.version,
+ updatedBy: deps.updatedBy,
now: deps.now,
});
const reconcileDeps: ReconcileDeps = {
diff --git a/console/packages/agent-controller/src/main.test.ts b/console/packages/agent-controller/src/main.test.ts
index f179a32d0..4043a22eb 100644
--- a/console/packages/agent-controller/src/main.test.ts
+++ b/console/packages/agent-controller/src/main.test.ts
@@ -45,6 +45,10 @@ describe('main', () => {
expect(lastLine()).toBe(
'switch-agent-controller: --controller-id and --server adopt an identity together; pass both.'
);
+ expect(await main(['run', '--updated-by-console', '--releases-dir', '/tmp/releases'])).toBe(
+ EXIT_CONFIGURATION
+ );
+ expect(lastLine()).toMatch(/--updated-by-console and --releases-dir disagree/);
expect(await main(['enroll', '--server', 'https://switch.example.com'])).toBe(
EXIT_CONFIGURATION
);
diff --git a/console/packages/agent-controller/src/main.ts b/console/packages/agent-controller/src/main.ts
index 9c1c185f8..5d76fa540 100644
--- a/console/packages/agent-controller/src/main.ts
+++ b/console/packages/agent-controller/src/main.ts
@@ -48,7 +48,7 @@ import { definitionProblem } from './reconcile';
import { isManagedRelease, readCurrent, throughCurrent } from './releases';
import { emptyObservation, InProcessRuntime, observeOnDisk, probeProvider } from './runtime';
import { AgentRuntimes } from './runtimes';
-import { type ControllerInfoChange, PROTOCOL_VERSION } from './schemas';
+import { type ControllerInfoChange, PROTOCOL_VERSION, type UpdatedBy } from './schemas';
import {
CONTROLLER_CREDENTIAL,
defaultSecretStoreKind,
@@ -115,7 +115,7 @@ Commands:
run [--data-dir <dir>] [--shared-host-bundle <path>]
[--controller-id <id> --server <agent-bridge-url> [--name <name>]]
[--credential-stdin] [--agent-runtime default|separate-user]
- [--releases-dir <dir>]
+ [--releases-dir <dir> | --updated-by-console]
Run the agents assigned to this machine and report their status.
--agent-runtime separate-user runs every agent as a Linux user of its
own, as set up by install-service --separate-users.
@@ -125,6 +125,9 @@ Commands:
controller credential from stdin and keeps it in memory only.
--releases-dir, which install-service passes, is where it installs
the releases Switch names, beside the ones before.
+ --updated-by-console, which Switch Console passes to a controller it
+ runs on an SSH host, says Console updates it: it follows no release
+ Switch names, and tells Switch so.
set-info [--name <name>] [--description <text>] [--data-dir <dir>]
Rename this machine and/or change its description on the server, with
this controller's own credential. Either or both; --description ""
@@ -375,6 +378,7 @@ async function runCommand(args: string[]): Promise<number> {
launchd: { type: 'boolean' },
'agent-runtime': { type: 'string' },
'releases-dir': { type: 'string' },
+ 'updated-by-console': { type: 'boolean' },
},
strict: true,
});
@@ -386,6 +390,10 @@ async function runCommand(args: string[]): Promise<number> {
'--releases-dir is for a service of your user; agents as users of their own read it from their setup.'
);
const releasesDir = values['releases-dir'] ? resolve(values['releases-dir']) : null;
+ if (values['updated-by-console'] && releasesDir !== null)
+ throw new UsageError(
+ '--updated-by-console and --releases-dir disagree: a controller Switch Console updates installs no releases of its own.'
+ );
// Before anything reads the environment: the agents inherit it.
const fromFile = values['env-file'] ? await readEnvFile(resolve(values['env-file'])) : {};
Object.assign(process.env, fromFile);
@@ -445,11 +453,14 @@ async function runCommand(args: string[]): Promise<number> {
file: values['env-file'],
names: Object.keys(fromFile),
});
- // A controller a parent runs (Switch Console's own) is updated with the parent.
- if (credential === null) void announceUpdate(log);
+ // A controller Switch Console runs (its own, handed its credential on stdin,
+ // or one it starts on an SSH host) is updated with Console, not by itself.
+ const updatedBy: UpdatedBy =
+ credential !== null || values['updated-by-console'] === true ? 'console' : 'self';
+ if (updatedBy === 'self') void announceUpdate(log);
try {
const selfUpdate =
- credential === null
+ updatedBy === 'self'
? new SelfUpdater({
version: VERSION,
installer: await installerFor(
@@ -531,6 +542,7 @@ async function runCommand(args: string[]): Promise<number> {
// no directory works in a folder of its own there.
workspacesFor: separateUsers ? () => unitAgentRoot(separateUsers) : serverWorkspacesDir,
version: VERSION,
+ updatedBy,
selfUpdate,
now: Date.now,
random: Math.random,
diff --git a/console/packages/agent-controller/src/schemas.test.ts b/console/packages/agent-controller/src/schemas.test.ts
index 3fa997a7b..9cc3515cb 100644
--- a/console/packages/agent-controller/src/schemas.test.ts
+++ b/console/packages/agent-controller/src/schemas.test.ts
@@ -180,7 +180,7 @@ describe('status report', () => {
const report = {
seq: 1,
observed_at: '2026-01-01T00:00:00Z',
- controller: { version: '0.1.0', protocol: 2, assignment_revision: 0 },
+ controller: { version: '0.1.0', protocol: 2, assignment_revision: 0, updated_by: 'self' },
machine: {
platform: { os: 'linux', arch: 'x64', os_version: '6.1' },
disk_free_bytes: 1,
diff --git a/console/packages/agent-controller/src/schemas.ts b/console/packages/agent-controller/src/schemas.ts
index 5611f7e09..47b538f14 100644
--- a/console/packages/agent-controller/src/schemas.ts
+++ b/console/packages/agent-controller/src/schemas.ts
@@ -242,6 +242,13 @@ export const agentStatusSchema = z
);
export type AgentStatus = z.infer<typeof agentStatusSchema>;
+/**
+ * Who moves this controller onto another release: itself, following the one
+ * Switch names, or Switch Console, which runs it and replaces its bundle.
+ */
+export const updatedBySchema = z.enum(['self', 'console']);
+export type UpdatedBy = z.infer<typeof updatedBySchema>;
+
export const statusReportSchema = z.object({
seq: z.number().int().positive(),
observed_at: time,
@@ -249,6 +256,7 @@ export const statusReportSchema = z.object({
version: z.string().min(1),
protocol: z.literal(PROTOCOL_VERSION),
assignment_revision: revision,
+ updated_by: updatedBySchema,
}),
machine: z.object({
platform: platformSchema,
diff --git a/console/packages/agent-controller/src/status.test.ts b/console/packages/agent-controller/src/status.test.ts
index 40c696d6e..9ed306d66 100644
--- a/console/packages/agent-controller/src/status.test.ts
+++ b/console/packages/agent-controller/src/status.test.ts
@@ -604,6 +604,7 @@ describe('StatusCollector', () => {
dataDir: dir,
workspacesDir: join(dir, 'workspaces'),
version: '0.1.0',
+ updatedBy: 'self',
now: () => clock,
});
store.recordApplied('agent-1', 2, '2026-01-01T11:00:00Z');
@@ -612,7 +613,12 @@ describe('StatusCollector', () => {
const assignment = { revision: 7, agents: [entry()] };
const first = await collector.collect(assignment);
expect(statusReportSchema.safeParse({ ...first, seq: 1 }).success).toBe(true);
- expect(first.controller).toEqual({ version: '0.1.0', protocol: 2, assignment_revision: 7 });
+ expect(first.controller).toEqual({
+ version: '0.1.0',
+ protocol: 2,
+ assignment_revision: 7,
+ updated_by: 'self',
+ });
expect(first.providers.map((p) => p.provider)).toEqual(['claude']);
expect(first.tools).toEqual([
{ tool: 'git', state: 'ok' },
diff --git a/console/packages/agent-controller/src/status.ts b/console/packages/agent-controller/src/status.ts
index 4d00f4c95..5082da900 100644
--- a/console/packages/agent-controller/src/status.ts
+++ b/console/packages/agent-controller/src/status.ts
@@ -24,6 +24,7 @@ import {
type ReasonCode,
type StatusReport,
type ToolStatus,
+ type UpdatedBy,
} from './schemas';
import type { GivenLogin, LoginProblem, SealedLogins } from './sealed-logins';
import type { AgentRow, ControllerStore } from './store';
@@ -550,6 +551,7 @@ export class StatusCollector {
/** Where agents with no directory of their own work, reported so the server can name it. */
workspacesDir: string;
version: string;
+ updatedBy: UpdatedBy;
now: () => number;
}
) {}
@@ -600,6 +602,7 @@ export class StatusCollector {
version: this.deps.version,
protocol: PROTOCOL_VERSION,
assignment_revision: assignment?.revision ?? 0,
+ updated_by: this.deps.updatedBy,
},
machine: {
platform: contractPlatform(),
diff --git a/console/packages/agent-controller/src/systemd-runtime.e2e.test.ts b/console/packages/agent-controller/src/systemd-runtime.e2e.test.ts
index 50b6f0e6a..ed67a8952 100644
--- a/console/packages/agent-controller/src/systemd-runtime.e2e.test.ts
+++ b/console/packages/agent-controller/src/systemd-runtime.e2e.test.ts
@@ -140,6 +140,7 @@ describe.skipIf(!dataDir)('agents as users of their own, under systemd', () => {
dataDir: dataDir!,
workspacesFor: () => join(dataDir!, 'workspaces'),
version: '0.1.0',
+ updatedBy: 'self',
selfUpdate: null,
now: Date.now,
random: () => 0,
diff --git a/core/switch_core/management/schemas.py b/core/switch_core/management/schemas.py
index 98d118e49..8c711e19a 100644
--- a/core/switch_core/management/schemas.py
+++ b/core/switch_core/management/schemas.py
@@ -170,6 +170,10 @@ class StatusControllerInfo(_StatusBody):
version: str
protocol: int
assignment_revision: int
+ # Who moves it onto another release: itself, following the release Core
+ # names, or Switch Console, which runs it (on an SSH host, say) and
+ # replaces its bundle. Absent from a controller older than this field.
+ updated_by: Literal["self", "console"] | None = None
class MachineStatus(_StatusBody):
@@ -523,13 +527,22 @@ def connection_view(
}
+def updated_by_console(controller: AgentController) -> bool:
+ """Whether Switch Console updates this controller: Console's own, or one
+ Console runs elsewhere and says so in its status. Either ships with
+ Console and cannot follow the release Core names."""
+ if controller.kind == "console":
+ return True
+ info = (controller.status or {}).get("controller") or {}
+ return info.get("updated_by") == "console"
+
+
def release_for(
controller: AgentController, release: ControllerRelease | None
) -> ControllerRelease | None:
- """The release this controller is told to run. None for a Switch Console
- one, whatever is set: the controller Console runs ships with Console and
- updates with it."""
- return None if controller.kind == "console" else release
+ """The release this controller is told to run. None for one Switch Console
+ updates, whatever is set."""
+ return None if updated_by_console(controller) else release
def controller_release_view(
diff --git a/core/tests/switch_core/fixtures/agent_controllers/controller_info_response.json b/core/tests/switch_core/fixtures/agent_controllers/controller_info_response.json
index cf96169a9..b2b88e16c 100644
--- a/core/tests/switch_core/fixtures/agent_controllers/controller_info_response.json
+++ b/core/tests/switch_core/fixtures/agent_controllers/controller_info_response.json
@@ -27,7 +27,8 @@
"controller": {
"version": "0.1.0",
"protocol": 1,
- "assignment_revision": 3
+ "assignment_revision": 3,
+ "updated_by": "self"
},
"machine": {
"platform": {
diff --git a/core/tests/switch_core/fixtures/agent_controllers/status_request.json b/core/tests/switch_core/fixtures/agent_controllers/status_request.json
index 452ae818c..443779f46 100644
--- a/core/tests/switch_core/fixtures/agent_controllers/status_request.json
+++ b/core/tests/switch_core/fixtures/agent_controllers/status_request.json
@@ -1,7 +1,7 @@
{
"seq": 42,
"observed_at": "2026-01-01T00:00:00Z",
- "controller": { "version": "0.1.0", "protocol": 2, "assignment_revision": 3 },
+ "controller": { "version": "0.1.0", "protocol": 2, "assignment_revision": 3, "updated_by": "self" },
"machine": {
"platform": { "os": "linux", "arch": "x64", "os_version": "6.1.0" },
"disk_free_bytes": 53687091200,
diff --git a/core/tests/switch_core/management/test_controller_routes.py b/core/tests/switch_core/management/test_controller_routes.py
index 2f4241c38..44280eaaf 100644
--- a/core/tests/switch_core/management/test_controller_routes.py
+++ b/core/tests/switch_core/management/test_controller_routes.py
@@ -546,6 +546,48 @@ class TestControllerRelease:
assert response.json()["controller_release"] is None
assert listed.json()[0]["release"] is None
+ async def test_a_controller_console_updates_is_told_no_release(
+ self, harness: Harness
+ ) -> None:
+ """One Switch Console runs on an SSH host enrolls as a daemon, but
+ follows Console's bundle, not the release Core names."""
+ owner = await add_member(harness.session_factory, "ada")
+ report = status_report(1)
+ report["controller"]["updated_by"] = "console"
+ async with harness.client() as client:
+ controller = await enroll_daemon(harness, client, owner)
+ await ensure_connected(client, controller)
+ response = await client.put(
+ f"/v1/management/controllers/{controller.controller_id}/status",
+ json=report,
+ headers=controller.headers,
+ )
+ listed = await client.get(
+ "/gateway/management/controllers", cookies=cookies_for(owner)
+ )
+ assert response.status_code == 200, response.text
+ assert response.json()["controller_release"] is None
+ view = listed.json()[0]
+ assert view["release"] is None
+ assert view["status"]["controller"]["updated_by"] == "console"
+
+ async def test_a_controller_that_updates_itself_is_told_the_release(
+ self, harness: Harness
+ ) -> None:
+ owner = await add_member(harness.session_factory, "ada")
+ report = status_report(1)
+ report["controller"]["updated_by"] = "self"
+ async with harness.client() as client:
+ controller = await enroll_daemon(harness, client, owner)
+ await ensure_connected(client, controller)
+ response = await client.put(
+ f"/v1/management/controllers/{controller.controller_id}/status",
+ json=report,
+ headers=controller.headers,
+ )
+ assert response.status_code == 200, response.text
+ assert response.json()["controller_release"]["version"] == "0.31.0"
+
async def _placed_agent(
harness: Harness, client, controller: EnrolledController, name: str = "reviewer"
diff --git a/docs/design/controller-contract-v1.md b/docs/design/controller-contract-v1.md
index 895df03a9..6a4a27e86 100644
--- a/docs/design/controller-contract-v1.md
+++ b/docs/design/controller-contract-v1.md
@@ -140,15 +140,20 @@ it and restarts once no agent session is in the middle of a turn (idle sessions
are restarted with it and resume their conversations). It says how that is going in
its report's `update` (`{ target, state, problem? }`), which Core stores with the
rest of the report. Rolling back is pointing the setting at the previous
-release's package. A controller older than the field ignores it. A Switch Console
-controller (kind `console`) is always told null: it ships with Console and updates
+release's package. A controller older than the field ignores it. A controller
+Switch Console updates is always told null: one of kind `console` (Console's own),
+or one whose last status said `controller.updated_by: "console"` (one Console runs
+on an SSH host, which enrolls as a `daemon`). It ships with Console and updates
with it.
```ts
type StatusReport = {
seq: number // monotonic per controller. The server drops anything older
observed_at: Time
- controller: { version: string; protocol: 1; assignment_revision: number }
+ controller: {
+ version: string; protocol: 1; assignment_revision: number
+ updated_by?: "self" | "console" // who moves it onto another release: itself, following controller_release, or Switch Console, which runs it and replaces its bundle. Absent from older controllers
+ }
machine: {
platform: Platform
disk_free_bytes: number; disk_total_bytes: number
diff --git a/gateway/src/data/management.ts b/gateway/src/data/management.ts
index 41dba7090..e4748c1c5 100644
--- a/gateway/src/data/management.ts
+++ b/gateway/src/data/management.ts
@@ -83,7 +83,13 @@ export interface AgentStatus {
export interface StatusReport {
seq: number;
observed_at: string;
- controller: { version: string; protocol: number; assignment_revision: number };
+ controller: {
+ version: string;
+ protocol: number;
+ assignment_revision: number;
+ /** Who moves it onto another release; absent from older controllers. */
+ updated_by?: "self" | "console";
+ };
machine: {
platform: Platform;
disk_free_bytes: number;
diff --git a/gateway/src/pages/machines/MachinesPage.tsx b/gateway/src/pages/machines/MachinesPage.tsx
index fa06774d1..129c7b465 100644
--- a/gateway/src/pages/machines/MachinesPage.tsx
+++ b/gateway/src/pages/machines/MachinesPage.tsx
@@ -142,9 +142,11 @@ function controllerVersion(row: Controller) {
return (
<Tooltip
title={
- release === null
- ? "Switch names no controller release for this machine."
- : `Runs ${release.wanted}, the release Switch names.`
+ release !== null
+ ? `Runs ${release.wanted}, the release Switch names.`
+ : row.kind === "console" || row.status?.controller.updated_by === "console"
+ ? "Updates with Switch Console, which runs it."
+ : "Switch names no controller release for this machine."
}
>
<span>{running ?? EM_DASH}</span>
@@ -159,7 +161,7 @@ function controllerVersion(row: Controller) {
color: "warning",
why:
row.state === "online"
- ? "It has said nothing about moving to it: a controller older than self-update never does, so update it by hand once."
+ ? "It has said nothing about moving to it: a controller older than self-update never does. Reinstall it once on the machine, or, if Switch Console runs it on an SSH host, update Console."
: "It moves to it once it is connected again.",
};
else if (update.state === "waiting_idle")