diff --git a/docker/agents/entrypoint.sh b/docker/agents/entrypoint.sh index 1718ea6..e08345b 100644 --- a/docker/agents/entrypoint.sh +++ b/docker/agents/entrypoint.sh @@ -11,8 +11,8 @@ set -euo pipefail # (default: all six). Uses while-true loop with staggered intervals: # - review-poll: every 5 minutes (offset by 0s) # - dev-poll: every 5 minutes (offset by 2 minutes) -# - gardener: every 6 hours (72 iterations * 5 min) -# - architect: every 6 hours (same as gardener) +# - gardener: every 6 hours by default (72 iterations * 5 min), configurable via GARDENER_INTERVAL +# - architect: every 6 hours by default (same as gardener), configurable via ARCHITECT_INTERVAL # - planner: every 12 hours (144 iterations * 5 min) # - predictor: every 24 hours (288 iterations * 5 min) @@ -179,13 +179,13 @@ while true; do # --- Slow agents: run in background with pgrep guard --- - # Gardener (every 6 hours = 72 iterations * 5 min = 21600 seconds) + # Gardener (default 6 hours = 21600 seconds) if [[ ",${AGENT_ROLES}," == *",gardener,"* ]]; then gardener_iteration=$((iteration * POLL_INTERVAL)) - gardener_interval=$((6 * 60 * 60)) # 6 hours in seconds + gardener_interval="${GARDENER_INTERVAL:-21600}" # default 6h, override via env var if [ $((gardener_iteration % gardener_interval)) -eq 0 ] && [ "$now" -ge "$gardener_iteration" ]; then if ! pgrep -f "gardener-run.sh" >/dev/null; then - log "Running gardener (iteration ${iteration}, 6-hour interval) for ${toml}" + log "Running gardener (iteration ${iteration}, ${gardener_interval}s interval) for ${toml}" gosu agent bash -c "cd ${DISINTO_DIR} && bash gardener/gardener-run.sh \"${toml}\"" >> "${DISINTO_DIR}/../data/logs/gardener.log" 2>&1 & else log "Skipping gardener — already running" @@ -193,13 +193,13 @@ while true; do fi fi - # Architect (every 6 hours, same schedule as gardener) + # Architect (default 6 hours, same schedule as gardener) if [[ ",${AGENT_ROLES}," == *",architect,"* ]]; then architect_iteration=$((iteration * POLL_INTERVAL)) - architect_interval=$((6 * 60 * 60)) # 6 hours in seconds + architect_interval="${ARCHITECT_INTERVAL:-21600}" # default 6h, override via env var if [ $((architect_iteration % architect_interval)) -eq 0 ] && [ "$now" -ge "$architect_iteration" ]; then if ! pgrep -f "architect-run.sh" >/dev/null; then - log "Running architect (iteration ${iteration}, 6-hour interval) for ${toml}" + log "Running architect (iteration ${iteration}, ${architect_interval}s interval) for ${toml}" gosu agent bash -c "cd ${DISINTO_DIR} && bash architect/architect-run.sh \"${toml}\"" >> "${DISINTO_DIR}/../data/logs/architect.log" 2>&1 & else log "Skipping architect — already running" diff --git a/lib/generators.sh b/lib/generators.sh index cabdf71..f8706e8 100644 --- a/lib/generators.sh +++ b/lib/generators.sh @@ -90,6 +90,8 @@ _generate_local_model_services() { WOODPECKER_DATA_DIR: /woodpecker-data FORGE_BOT_USER_${service_name^^}: "${forge_user}" POLL_INTERVAL: "${poll_interval_val}" + GARDENER_INTERVAL: \${GARDENER_INTERVAL:-21600} + ARCHITECT_INTERVAL: \${ARCHITECT_INTERVAL:-21600} depends_on: - forgejo - woodpecker @@ -290,6 +292,8 @@ services: DISINTO_CONTAINER: "1" PROJECT_REPO_ROOT: /home/agent/repos/${PROJECT_NAME:-project} WOODPECKER_DATA_DIR: /woodpecker-data + GARDENER_INTERVAL: ${GARDENER_INTERVAL:-21600} + ARCHITECT_INTERVAL: ${ARCHITECT_INTERVAL:-21600} # IMPORTANT: agents get explicit environment variables (forge tokens, CI tokens, config). # Vault-only secrets (GITHUB_TOKEN, CLAWHUB_TOKEN, deploy keys) live in # .env.vault.enc and are NEVER injected here — only the runner diff --git a/projects/disinto.toml.example b/projects/disinto.toml.example index 04e99e5..ebbff93 100644 --- a/projects/disinto.toml.example +++ b/projects/disinto.toml.example @@ -23,6 +23,14 @@ check_prs = true check_dev_agent = true check_pipeline_stall = false +# Agent scheduling — configure gardener and architect polling intervals +# in the docker-compose.yml environment section (or .env file). +# Values are in seconds, defaults are 21600 (6 hours) for both. +# +# For active development on the disinto factory itself, consider: +# GARDENER_INTERVAL=3600 # 1 hour +# ARCHITECT_INTERVAL=600 # 10 minutes + # Local-model agents (optional) — configure to use llama-server or similar # for local LLM inference. Each agent gets its own container with isolated # credentials and configuration.