Files
timmy-config/bin/start-loops.sh
perplexity 6d713aeeb9
Some checks failed
PR Checklist / pr-checklist (pull_request) Failing after 1m18s
purge: remove Anthropic from all wizard configs, playbooks, and fleet scripts
Golden state: Kimi K2.5 primary → Gemini via OpenRouter → local Ollama.
Anthropic is gone from every active config, fallback chain, and loop script.

Wizard configs (3):
- allegro, bezalel, ezra: removed anthropic from fallback_providers,
  replaced with gemini + ollama. Removed anthropic provider section.

Playbooks (7):
- All playbooks now use kimi-k2.5 as preferred, google/gemini-2.5-pro
  as fallback. No claude model references remain.

Fleet scripts (8):
- claude-loop.sh: deprecated (exit 0, original preserved as reference)
- claudemax-watchdog.sh: deprecated (exit 0)
- agent-loop.sh: removed claude dispatch case
- start-loops.sh: removed claude-locks, claude-loop from proc list
- timmy-orchestrator.sh: removed claude worker monitoring
- fleet-status.sh: zeroed claude loop counter
- model-health-check.sh: replaced check_anthropic_model with check_kimi_model
- ops-gitea.sh, ops-helpers.sh, ops-panel.sh: removed claude from agent lists

Infrastructure (5):
- wizard_bootstrap.py: removed anthropic pip package and API key checks
- WIZARD_ENVIRONMENT_CONTRACT.md: replaced ANTHROPIC keys with KIMI
- DEPLOY.md: replaced ANTHROPIC_API_KEY with KIMI_API_KEY
- fallback-portfolios.yaml: replaced anthropic provider with kimi-coding
- fleet-vocabulary.md: updated Ezra and Claude entries to Kimi K2.5

Docs (2):
- sonnet-workforce.md: deprecated with notice
- GoldenRockachopa-checkin.md: updated model references

Preserved (not touched):
- training/ data (changing would corrupt training set)
- evaluations/ (historical benchmarks)
- RELEASE_*.md (changelogs)
- metrics_helpers.py (historical cost calculation)
- hermes-sovereign/githooks/pre-commit.py (secret detection - still useful)
- security/secret-scan.yml (key detection - still useful)
- architecture_linter.py (warns about anthropic usage - desired behavior)
- test_sovereignty_enforcement.py (tests anthropic is blocked - correct)
- son-of-timmy.md philosophical references (Claude as one of many backends)

Refs: Sovereignty directive, zero-cloud vision
2026-04-09 19:21:48 +00:00

99 lines
4.0 KiB
Bash
Executable File

#!/usr/bin/env bash
# start-loops.sh — Start all Hermes agent loops (orchestrator + workers)
# Validates model health, cleans stale state, launches loops with nohup.
# Part of Gitea issue #126.
#
# Usage: start-loops.sh
set -euo pipefail
HERMES_BIN="$HOME/.hermes/bin"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
LOG_DIR="$HOME/.hermes/logs"
# CLAUDE_LOCKS removed — Anthropic purged
GEMINI_LOCKS="$LOG_DIR/gemini-locks"
mkdir -p "$LOG_DIR" "$GEMINI_LOCKS"
log() {
echo "[$(date '+%Y-%m-%d %H:%M:%S')] START-LOOPS: $*"
}
# ── 1. Model health check ────────────────────────────────────────────
log "Running model health check..."
if ! bash "$SCRIPT_DIR/model-health-check.sh"; then
log "FATAL: Model health check failed. Aborting loop startup."
exit 1
fi
log "Model health check passed."
# ── 2. Kill stale loop processes ──────────────────────────────────────
log "Killing stale loop processes..."
for proc_name in gemini-loop timmy-orchestrator; do
pids=$(pgrep -f "${proc_name}\\.sh" 2>/dev/null || true)
if [ -n "$pids" ]; then
log " Killing stale $proc_name PIDs: $pids"
echo "$pids" | xargs kill 2>/dev/null || true
sleep 1
# Force-kill any survivors
pids=$(pgrep -f "${proc_name}\\.sh" 2>/dev/null || true)
if [ -n "$pids" ]; then
echo "$pids" | xargs kill -9 2>/dev/null || true
fi
else
log " No stale $proc_name found."
fi
done
# ── 3. Clear lock directories ────────────────────────────────────────
log "Clearing lock dirs..."
# CLAUDE_LOCKS removed — Anthropic purged
rm -rf "${GEMINI_LOCKS:?}"/*
log " Cleared $CLAUDE_LOCKS and $GEMINI_LOCKS"
# ── 4. Launch loops with nohup ───────────────────────────────────────
log "Launching timmy-orchestrator..."
nohup bash "$HERMES_BIN/timmy-orchestrator.sh" \
>> "$LOG_DIR/timmy-orchestrator-nohup.log" 2>&1 &
ORCH_PID=$!
log " timmy-orchestrator PID: $ORCH_PID"
log "Launching claude-loop (5 workers)..."
nohup bash "$HERMES_BIN/claude-loop.sh" 5 \
>> "$LOG_DIR/claude-loop-nohup.log" 2>&1 &
CLAUDE_PID=$!
log " claude-loop PID: $CLAUDE_PID"
log "Launching gemini-loop (3 workers)..."
nohup bash "$HERMES_BIN/gemini-loop.sh" 3 \
>> "$LOG_DIR/gemini-loop-nohup.log" 2>&1 &
GEMINI_PID=$!
log " gemini-loop PID: $GEMINI_PID"
# ── 5. PID summary ───────────────────────────────────────────────────
log "Waiting 3s for processes to settle..."
sleep 3
echo ""
echo "═══════════════════════════════════════════════════"
echo " HERMES LOOP STATUS"
echo "═══════════════════════════════════════════════════"
printf " %-25s %s\n" "PROCESS" "PID / STATUS"
echo "───────────────────────────────────────────────────"
for entry in "timmy-orchestrator:$ORCH_PID" "claude-loop:$CLAUDE_PID" "gemini-loop:$GEMINI_PID"; do
name="${entry%%:*}"
pid="${entry##*:}"
if kill -0 "$pid" 2>/dev/null; then
printf " %-25s %s\n" "$name" "$pid ✓ running"
else
printf " %-25s %s\n" "$name" "$pid ✗ DEAD"
fi
done
echo "───────────────────────────────────────────────────"
echo " Logs: $LOG_DIR/*-nohup.log"
echo "═══════════════════════════════════════════════════"
echo ""
log "All loops launched."