From e64efd9185d42167cbe62ef7dbe4ac8496a52cfd Mon Sep 17 00:00:00 2001 From: Alexander Whitestone Date: Sun, 22 Mar 2026 19:42:47 -0400 Subject: [PATCH] =?UTF-8?q?perf:=20max=20speed=20=E2=80=94=202s=20cooldown?= =?UTF-8?q?,=2010s=20idle=20poll,=2090s=20scaler,=2010+5=20workers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hit rate limits, don't play it safe. Scale down only when forced. Co-Authored-By: Claude Opus 4.6 --- bin/claude-loop.sh | 12 ++++++------ bin/gemini-loop.sh | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/bin/claude-loop.sh b/bin/claude-loop.sh index da04ae9..2e7ca9e 100755 --- a/bin/claude-loop.sh +++ b/bin/claude-loop.sh @@ -8,15 +8,15 @@ set -euo pipefail # === CONFIG === -NUM_WORKERS="${1:-7}" +NUM_WORKERS="${1:-10}" MAX_WORKERS=21 # absolute ceiling WORKTREE_BASE="$HOME/worktrees" GITEA_URL="http://143.198.27.163:3000" GITEA_TOKEN=$(cat "$HOME/.hermes/claude_token") CLAUDE_TIMEOUT=900 # 15 min per issue -COOLDOWN=5 # seconds between issues (fast cycle) -RATE_LIMIT_SLEEP=60 # initial sleep on rate limit -MAX_RATE_SLEEP=300 # max backoff on rate limit +COOLDOWN=2 # seconds between issues — max speed +RATE_LIMIT_SLEEP=30 # initial sleep on rate limit +MAX_RATE_SLEEP=120 # max backoff on rate limit LOG_DIR="$HOME/.hermes/logs" SKIP_FILE="$LOG_DIR/claude-skip-list.json" LOCK_DIR="$LOG_DIR/claude-locks" @@ -282,7 +282,7 @@ run_worker() { if [ "$issue_json" = "null" ] || [ -z "$issue_json" ]; then update_active "$worker_id" "" "" "idle" - sleep 60 + sleep 10 continue fi @@ -436,7 +436,7 @@ done # Every 3 minutes: check health, scale up if no rate limits, scale down if hitting limits CURRENT_WORKERS="$NUM_WORKERS" while true; do - sleep 180 + sleep 90 # Reap dead workers and relaunch for pidfile in "$PID_DIR"/*.pid; do diff --git a/bin/gemini-loop.sh b/bin/gemini-loop.sh index d65abb5..a07ff69 100755 --- a/bin/gemini-loop.sh +++ b/bin/gemini-loop.sh @@ -8,15 +8,15 @@ set -euo pipefail # === CONFIG === -NUM_WORKERS="${1:-3}" +NUM_WORKERS="${1:-5}" MAX_WORKERS=12 WORKTREE_BASE="$HOME/worktrees" GITEA_URL="http://143.198.27.163:3000" GITEA_TOKEN=$(cat "$HOME/.hermes/gemini_token") GEMINI_TIMEOUT=600 # 10 min per issue -COOLDOWN=5 # seconds between issues -RATE_LIMIT_SLEEP=60 -MAX_RATE_SLEEP=300 +COOLDOWN=2 # seconds between issues — max speed +RATE_LIMIT_SLEEP=30 +MAX_RATE_SLEEP=120 LOG_DIR="$HOME/.hermes/logs" SKIP_FILE="$LOG_DIR/gemini-skip-list.json" LOCK_DIR="$LOG_DIR/gemini-locks" @@ -263,7 +263,7 @@ run_worker() { if [ "$issue_json" = "null" ] || [ -z "$issue_json" ]; then update_active "$worker_id" "" "" "idle" - sleep 60 + sleep 10 continue fi @@ -406,7 +406,7 @@ done # Dynamic scaler — every 3 minutes CURRENT_WORKERS="$NUM_WORKERS" while true; do - sleep 180 + sleep 90 # Reap dead workers for pidfile in "$PID_DIR"/*.pid; do