Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Claude
45cac8c050 fix: feat: make gardener and architect schedules configurable via env vars (#558)
Some checks failed
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline failed
ci/woodpecker/pr/smoke-init Pipeline was successful
2026-04-10 10:29:56 +00:00
3 changed files with 20 additions and 8 deletions

View file

@ -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"

View file

@ -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

View file

@ -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.