From 0346bfef77d11eb63dcdc77e1088331ce3a601e7 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Sat, 21 Nov 2026 01:16:41 +1100 Subject: [PATCH] fix(configuration): require containers.image instead of a private-registry default (#2054) applyContainerDefaults no longer fills containers.image with a hard-coded private-registry reference. An unset image now fails configuration validation with 'containers.image is required for autonomous workflow workers', so a fresh instance is told at startup (and via the readiness probe at runtime) instead of at the first failed container pull. Configs that relied on the default now set it explicitly: dev.toml (the local task image:agent build, which e2e also overlays), plus commented [containers] blocks in config.example.toml and standalone.toml. The deploy docs no longer describe a code-level default. --- config.example.toml | 9 +++++++++ deployments/INSTRUCTIONS.md | 10 ++++++---- deployments/dev.toml | 8 ++++++++ deployments/standalone.toml | 8 ++++++++ deployments/systemd-user-service.md | 13 +++++++------ internal/config/config.go | 4 +++- internal/infrastructure/configuration/defaults.go | 10 ++++------ 7 files changed, 45 insertions(+), 17 deletions(-) diff --git a/config.example.toml b/config.example.toml index 27265da02..e292cae15 100644 --- a/config.example.toml +++ b/config.example.toml @@ -98,6 +98,15 @@ target = "127.0.0.1:9090" # catalogue = "registry.example/owner/archipelago/catalogue" # catalogue_key = "base64 public key" +# The image task containers run. There is no default: the daemon reports a +# missing containers.image at startup instead of guessing a registry, so set +# your own pinned reference -- see +# deployments/systemd-user-service.md#6-pinning-the-archie-agent-image. +# [containers] +# image = "registry.example.com/archie/archie-agent@sha256:" +# pull_policy = "missing" +# registry_auth = { engine = "env", key = "ARCHIE_REGISTRY_AUTH" } # when the registry needs a login + # Long-running agent loops that maintain memory, skills and — in dry run — # file follow-up issues from recent runs. Definitions are data: the server # validates them and the gateway applies them live. diff --git a/deployments/INSTRUCTIONS.md b/deployments/INSTRUCTIONS.md index 4f85c816c..dc8c8f017 100644 --- a/deployments/INSTRUCTIONS.md +++ b/deployments/INSTRUCTIONS.md @@ -16,10 +16,12 @@ of its own (`deployments/systemd-user-service.md`). `archie-agent` (the per-task sandboxed runtime) has no unit of its own. The agent image is a separate thing, pulled for the containers `archied` spawns -per task: `[containers].image` defaults to -`git.catlow.cloud/sam/archie-agent:latest`, while this archive's `release.json` -pins the digest the release published. Set `[containers].registry_auth` when -that reference is on a registry that needs a login -- see +per task: `[containers].image` has no default, and the daemon reports it as +missing at startup. This archive's `release.json` pins the digest the release +published, and the deploy step passes it to the install, so a release install +needs nothing by hand; a from-source install sets the image itself. Set +`[containers].registry_auth` when the reference is on a registry that needs a +login -- see `deployments/systemd-user-service.md#6-pinning-the-archie-agent-image`. ## Quickstart diff --git a/deployments/dev.toml b/deployments/dev.toml index 8109f9e12..653bd1f5c 100644 --- a/deployments/dev.toml +++ b/deployments/dev.toml @@ -31,6 +31,14 @@ listen = "127.0.0.1:8484" mode = "embedded" url = "" +# Task containers run the agent image `task image:agent` builds locally +# (docker-compose.yml tags it git.catlow.cloud/sam/archie-agent:latest), and +# the "missing" pull policy never pulls over the local build. There is no +# code-level default image: an unset containers.image fails validation at +# startup. +[containers] +image = "git.catlow.cloud/sam/archie-agent:latest" + # `task dev` runs archie-state-store via dev:state-store, which passes no # -listen, so the listen below is the port the store binds. It must agree with # the target: these two lines are the only place that pair is stated. Move them diff --git a/deployments/standalone.toml b/deployments/standalone.toml index 53a0aeda8..91c9e6b1d 100644 --- a/deployments/standalone.toml +++ b/deployments/standalone.toml @@ -58,3 +58,11 @@ models = [ [budgets] max_steps = 60 wall_clock = "30m" + +# The image task containers run. There is no default: the daemon refuses to +# start without it and names the key, so set your own pinned reference here -- +# see deployments/systemd-user-service.md#6-pinning-the-archie-agent-image. +# [containers] +# image = "registry.example.com/archie/archie-agent@sha256:" +# pull_policy = "missing" +# registry_auth = { engine = "env", key = "ARCHIE_REGISTRY_AUTH" } # when the registry needs a login diff --git a/deployments/systemd-user-service.md b/deployments/systemd-user-service.md index d5779dbba..8be80c618 100644 --- a/deployments/systemd-user-service.md +++ b/deployments/systemd-user-service.md @@ -132,13 +132,14 @@ interactive chat keeps the host access the operator configured, while every autonomous repository workflow runs in a task-scoped Docker container. No Compose service or host `archie-agent` binary is required. -Docker must be installed and reachable by the service user. With no explicit -broker or container settings, Archie defaults `containers.image` to -`git.catlow.cloud/sam/archie-agent:latest`. `single-forge-github.toml` and -`docker-nats-stack.toml` override that default with a pinned reference -(`standalone.toml` and `dev.toml` leave it) -- see +Docker must be installed and reachable by the service user. `containers.image` +has no default: with it unset the daemon refuses to start and names the key, +so a fresh install learns about it at startup, not at the first failed pull. +`single-forge-github.toml` and `docker-nats-stack.toml` set a pinned +reference; `standalone.toml` and `dev.toml` leave it for the operator to set +-- see [Pinning the archie-agent image](#6-pinning-the-archie-agent-image) below. An -explicit equivalent, pinned the same way, is: +explicit reference, pinned the same way, is: ```toml [nats] diff --git a/internal/config/config.go b/internal/config/config.go index 80087ee68..c96d7062f 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -734,7 +734,9 @@ type OpenShellConfig struct { // ContainerConfig configures Docker sandbox execution of archie-agent. type ContainerConfig struct { - // Image is the Docker image to run (e.g. "git.catlow.cloud/sam/archie-agent:latest"). + // Image is the Docker image task workers run (e.g. "registry.example.com/archie/archie-agent:v1"). + // There is no default: validation requires it so a fresh instance is told + // at startup rather than at the first failed pull. Image string `toml:"image" yaml:"image"` // MaxConcurrency limits simultaneous daemon tasks and containers. // Tasks from the same repository remain serialized. 0 = no limit. diff --git a/internal/infrastructure/configuration/defaults.go b/internal/infrastructure/configuration/defaults.go index 4e3b9161a..9ee3b46c7 100644 --- a/internal/infrastructure/configuration/defaults.go +++ b/internal/infrastructure/configuration/defaults.go @@ -26,7 +26,6 @@ const ( defaultContainerUptime = 5 * time.Hour defaultVolumeTTL = 72 * time.Hour defaultPullPolicy = "missing" - defaultContainerImage = "git.catlow.cloud/sam/archie-agent:latest" // defaultMaxResultChars bounds one tool result. defaultMaxResultChars = 50_000 @@ -322,12 +321,11 @@ func DefaultBotEmail(forgeType, user, email string) string { return email } -// applyContainerDefaults makes managed task workers usable without an explicit -// [containers] section. A negative VolumeTTL is left for validation to reject. +// applyContainerDefaults fills the optional [containers] values. There is +// deliberately no default image: validateContainers reports a missing +// containers.image at startup instead of pointing task workers at one +// registry. A negative VolumeTTL is left for validation to reject. func applyContainerDefaults(cfg *config.Config) { - if cfg.Containers.Image == "" { - cfg.Containers.Image = defaultContainerImage - } if cfg.Containers.MaxUptime == 0 { cfg.Containers.MaxUptime = config.Duration(defaultContainerUptime) }