# cleveragents controller — worker EnvironmentFile (shared across # all worker instances on this host). # Copy to /etc/cleveragents/worker.env. Per-instance overrides go in # /etc/cleveragents/worker..env (e.g. worker.implementer-1.env). # ─── infrastructure (REQUIRED, must match master.env) ───────────── CLEVERAGENTS_DB_URL=postgresql+psycopg2://cleveragents:CHANGEME@db.internal:5432/cleveragents_controller CONTROLLER_OPENCODE_URL=http://opencode.internal:4096 # Forgejo (same fields as master.env). FORGEJO_URL=https://git.cleverthis.com FORGEJO_TOKEN=CHANGEME-forgejo-pat FORGEJO_USER=cleveragents-bot # ─── role pool ──────────────────────────────────────────────────── # Comma-separated. Default: all 5 roles. Specialise per instance via # /etc/cleveragents/worker..env: # CLEVERAGENTS_WORKER_ROLES=implementer # A typical multi-machine deployment: # worker@implementer-1, implementer-2 → CLEVERAGENTS_WORKER_ROLES=implementer # worker@reviewer-1 → CLEVERAGENTS_WORKER_ROLES=reviewer # worker@estimator-1 → CLEVERAGENTS_WORKER_ROLES=estimator,summarizer,conflict_resolver CLEVERAGENTS_WORKER_ROLES=implementer,reviewer,estimator,conflict_resolver,summarizer # ─── concurrency ────────────────────────────────────────────────── # Size of the ThreadPoolExecutor INSIDE this single worker process — # how many attempts run concurrently as pool THREADS. This does NOT # spawn extra worker processes. Default 1. Scale out by adding worker # instances (separate processes/machines); only bump this toward your # OpenCode per-instance concurrency ceiling. CONTROLLER_MAX_CONCURRENT_WORKER_THREADS_PER_MACHINE=1 # How often this worker polls the DB for pending attempts. CONTROLLER_WORKER_POLL_INTERVAL_S=5 # How often the in_progress heartbeat is updated (must be < the # lock_ttl_seconds the master writes — currently 600s). CONTROLLER_HEARTBEAT_INTERVAL_S=30 # ─── per-tier session timeouts ──────────────────────────────────── CONTROLLER_TIER_0_TIMEOUT_S=600 CONTROLLER_TIER_1_TIMEOUT_S=1200 CONTROLLER_TIER_2_TIMEOUT_S=1800 CONTROLLER_DEFAULT_AGENT_TIMEOUT_S=600 # ─── logging ────────────────────────────────────────────────────── CONTROLLER_LOG_LEVEL=INFO