Files
cleveragents-core/tools/controller/deploy/systemd/worker.env.example
T
drew f454670a0e chore(controller): launch merge_drive from the pipeline script; rename worker-concurrency env var
The launch script now starts merge_drive by default (T5-7: it is the
controller's singleton merge stage — APPROVED -> MERGING -> MERGED).
Previously the script killed merge_drive as a "legacy" process but
never started it, so controller workflows dead-ended at APPROVED.
merge_drive moves into the CONTROLLER process group; --no-merge skips
it. Also adds the worker thread-pool concurrency knob (default 2 for
the trial harness).

Renames the misleadingly-named env var
CONTROLLER_MAX_CONCURRENT_WORKERS_PER_MACHINE ->
CONTROLLER_MAX_CONCURRENT_WORKER_THREADS_PER_MACHINE: it sizes a
ThreadPoolExecutor inside one worker process, it does not spawn
worker processes.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-19 19:18:23 -04:00

48 lines
2.6 KiB
Bash

# 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.<instance>.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.<instance>.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