-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathralph-build.sh
More file actions
executable file
·62 lines (47 loc) · 1.84 KB
/
ralph-build.sh
File metadata and controls
executable file
·62 lines (47 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
# Ralph BUILDING Loop with Key Rotation
set -euo pipefail
cd /home/admin/clawd/projects/info-flow-platform
echo "🚀 Ralph BUILDING Loop for InfoFlow Platform"
echo ""
MAX_ITERS=20
ITER=0
while [ $ITER -lt $MAX_ITERS ]; do
ITER=$((ITER + 1))
echo "═══════════════════════════════════════════════════"
echo "🔄 BUILDING Iteration $ITER/$MAX_ITERS"
echo "═══════════════════════════════════════════════════"
# Get active API key
echo "🔑 Getting active API key..."
ACTIVE_KEY=$(python3 scripts/key_manager.py get)
if [ -z "$ACTIVE_KEY" ]; then
echo "❌ No active API key available. Waiting 60s..."
sleep 60
python3 scripts/key_manager.py reset
continue
fi
echo "✅ Using key: ${ACTIVE_KEY:0:10}..."
# Export key for subagent
export OPENAI_API_KEY="$ACTIVE_KEY"
# Spawn building subagent
echo "🤖 Spawning building agent..."
# Note: This uses moltbot sessions_spawn internally
# The subagent will use the exported OPENAI_API_KEY
# Check if IMPLEMENTATION_PLAN shows completion
if grep -q "STATUS: PHASE1_COMPLETE" IMPLEMENTATION_PLAN.md 2>/dev/null; then
echo ""
echo "✅ Phase 1 complete! Stopping BUILDING loop."
exit 0
fi
# Check if all tasks done
if ! grep -q "\[ \]" IMPLEMENTATION_PLAN.md; then
echo ""
echo "✅ All tasks complete! Stopping BUILDING loop."
exit 0
fi
# Wait between iterations to avoid rate limits
echo "⏳ Waiting 30s before next iteration..."
sleep 30
done
echo "⚠️ Max iterations reached."
exit 1