From 41dbed030be02698735d31e17a3614f063c09e7b Mon Sep 17 00:00:00 2001 From: Agent Date: Thu, 16 Apr 2026 13:58:22 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20bug:=20TOML-driven=20agent=20services=20?= =?UTF-8?q?lack=20FACTORY=5FREPO=20env=20and=20projects/env/state=20volume?= =?UTF-8?q?=20mounts=20=E2=80=94=20sidecar=20silently=20never=20polls=20(#?= =?UTF-8?q?855)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In _generate_local_model_services: - Add FACTORY_REPO environment variable to enable factory bootstrap - Add volume mounts for ./projects, ./.env, and ./state to provide real project TOMLs In entrypoint.sh: - Add validate_projects_dir() function that fails loudly if no real .toml files are found in the projects directory (prevents silent-zombie mode where the polling loop matches zero files and does nothing forever) This fixes the issue where hired agents (via hire-an-agent) ran forever without picking up any work because they were pinned to the baked /home/agent/disinto directory with only *.toml.example files. --- docker/agents/entrypoint.sh | 19 +++++++++++++++++++ lib/generators.sh | 4 ++++ 2 files changed, 23 insertions(+) diff --git a/docker/agents/entrypoint.sh b/docker/agents/entrypoint.sh index a664a09..89a520b 100644 --- a/docker/agents/entrypoint.sh +++ b/docker/agents/entrypoint.sh @@ -342,9 +342,28 @@ bootstrap_ops_repos # Bootstrap factory repo — switch DISINTO_DIR to live checkout (#593) bootstrap_factory_repo +# Validate that projects directory has at least one real .toml file (not .example) +# This prevents the silent-zombie mode where the polling loop matches zero files +# and does nothing forever. +validate_projects_dir() { + local toml_count + toml_count=$(compgen -G "${DISINTO_DIR}/projects/*.toml" 2>/dev/null | wc -l) + if [ "$toml_count" -eq 0 ]; then + log "FATAL: No real .toml files found in ${DISINTO_DIR}/projects/" + log "Expected at least one project config file (e.g., disinto.toml)" + log "The directory only contains *.toml.example template files." + log "Mount the host ./projects volume or copy real .toml files into the container." + exit 1 + fi + log "Projects directory validated: ${toml_count} real .toml file(s) found" +} + # Initialize state directory for check_active guards init_state_dir +# Validate projects directory before entering polling loop +validate_projects_dir + # Parse AGENT_ROLES env var (default: all agents) # Expected format: comma-separated list like "review,dev,gardener" AGENT_ROLES="${AGENT_ROLES:-review,dev,gardener,architect,planner,predictor,supervisor}" diff --git a/lib/generators.sh b/lib/generators.sh index 59339ac..8042457 100644 --- a/lib/generators.sh +++ b/lib/generators.sh @@ -134,9 +134,13 @@ _generate_local_model_services() { - \${CLAUDE_CONFIG_FILE:-\${HOME}/.claude.json}:/home/agent/.claude.json:ro - \${CLAUDE_BIN_DIR}:/usr/local/bin/claude:ro - \${AGENT_SSH_DIR:-\${HOME}/.ssh}:/home/agent/.ssh:ro + - ./projects:/home/agent/disinto/projects:ro + - ./.env:/home/agent/disinto/.env:ro + - ./state:/home/agent/disinto/state environment: FORGE_URL: http://forgejo:3000 FORGE_REPO: ${FORGE_REPO:-disinto-admin/disinto} + FACTORY_REPO: ${FORGE_REPO:-disinto-admin/disinto} # Per-agent credentials keyed by forge_user (#834 Gap 3). FORGE_TOKEN: \${FORGE_TOKEN_${user_upper}:-} FORGE_PASS: \${FORGE_PASS_${user_upper}:-} -- 2.49.1