fix: fix: entrypoint-llama.sh install_project_crons ignores DISINTO_AGENTS — installs all agents (#310)
Remove install_project_crons() function and cron daemon startup from entrypoint-llama.sh. The llama container runs dev-poll via its while loop only — cron is not suitable as it doesn't inherit Docker compose env vars (ANTHROPIC_API_KEY, ANTHROPIC_BASE_URL, CLAUDE_CONFIG_DIR). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
c9e9c887db
commit
e2e4ca5579
1 changed files with 0 additions and 60 deletions
|
|
@ -28,68 +28,8 @@ if [ ! -d "${PROJECT_REPO_ROOT}/.git" ]; then
|
||||||
log "Repo cloned"
|
log "Repo cloned"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install crontab entries for agent user from project TOMLs
|
|
||||||
install_project_crons() {
|
|
||||||
local cron_lines="DISINTO_CONTAINER=1
|
|
||||||
USER=agent
|
|
||||||
FORGE_URL=http://forgejo:3000"
|
|
||||||
|
|
||||||
# Parse DISINTO_AGENTS env var (default: all agents)
|
|
||||||
# Expected format: comma-separated list like "review,gardener" or "dev"
|
|
||||||
local agents_to_run="review,dev,gardener"
|
|
||||||
if [ -n "${DISINTO_AGENTS:-}" ]; then
|
|
||||||
agents_to_run="$DISINTO_AGENTS"
|
|
||||||
fi
|
|
||||||
|
|
||||||
for toml in "${DISINTO_DIR}"/projects/*.toml; do
|
|
||||||
[ -f "$toml" ] || continue
|
|
||||||
local pname
|
|
||||||
pname=$(python3 -c "
|
|
||||||
import sys, tomllib
|
|
||||||
with open(sys.argv[1], 'rb') as f:
|
|
||||||
print(tomllib.load(f)['name'])
|
|
||||||
" "$toml" 2>/dev/null) || continue
|
|
||||||
|
|
||||||
cron_lines="${cron_lines}
|
|
||||||
PROJECT_REPO_ROOT=/home/agent/repos/${pname}
|
|
||||||
# disinto: ${pname}"
|
|
||||||
|
|
||||||
# Add review-poll only if review agent is configured
|
|
||||||
if echo "$agents_to_run" | grep -qw "review"; then
|
|
||||||
cron_lines="${cron_lines}
|
|
||||||
2,7,12,17,22,27,32,37,42,47,52,57 * * * * ${DISINTO_DIR}/review/review-poll.sh ${toml} >>/home/agent/data/logs/cron.log 2>&1"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Add dev-poll only if dev agent is configured
|
|
||||||
if echo "$agents_to_run" | grep -qw "dev"; then
|
|
||||||
cron_lines="${cron_lines}
|
|
||||||
4,9,14,19,24,29,34,39,44,49,54,59 * * * * ${DISINTO_DIR}/dev/dev-poll.sh ${toml} >>/home/agent/data/logs/cron.log 2>&1"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Add gardener-run only if gardener agent is configured
|
|
||||||
if echo "$agents_to_run" | grep -qw "gardener"; then
|
|
||||||
cron_lines="${cron_lines}
|
|
||||||
0 0,6,12,18 * * * cd ${DISINTO_DIR} && bash gardener/gardener-run.sh ${toml} >>/home/agent/data/logs/cron.log 2>&1"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -n "$cron_lines" ]; then
|
|
||||||
printf '%s\n' "$cron_lines" | crontab -u agent -
|
|
||||||
log "Installed crontab for agent user (agents: ${agents_to_run})"
|
|
||||||
else
|
|
||||||
log "No project TOMLs found — crontab empty"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
log "Entering poll loop (interval: ${POLL_INTERVAL:-300}s)"
|
log "Entering poll loop (interval: ${POLL_INTERVAL:-300}s)"
|
||||||
|
|
||||||
# Install and start cron daemon
|
|
||||||
DISINTO_DIR="/home/agent/disinto"
|
|
||||||
install_project_crons
|
|
||||||
log "Starting cron daemon"
|
|
||||||
cron
|
|
||||||
log "cron daemon started"
|
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
# Clear stale session IDs before each poll.
|
# Clear stale session IDs before each poll.
|
||||||
# Local llama does not support --resume (no server-side session storage).
|
# Local llama does not support --resume (no server-side session storage).
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue