-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreset_test.sh
More file actions
executable file
·44 lines (37 loc) · 1.16 KB
/
reset_test.sh
File metadata and controls
executable file
·44 lines (37 loc) · 1.16 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
#!/bin/bash
# Supervisor script: Reset target project and run Night Shift Agent test
# Usage: ./reset_test.sh [project-dir]
set -e
PROJECT_DIR="${1:-/Users/nick/AndroidStudioProjects/kmp-agentic-ci-template}"
LOG_FILE="/tmp/agent_run.log"
echo "=== Night Shift Agent Test Runner ==="
echo "Target: $PROJECT_DIR"
echo ""
# Kill any running agent
echo "Stopping any running agents..."
pkill -f "agent_night_shift.py" 2>/dev/null || true
pkill -f "claude --print" 2>/dev/null || true
sleep 1
# Reset target project
echo "Resetting target project to origin/main..."
cd "$PROJECT_DIR"
git fetch origin
git checkout main
git reset --hard origin/main
git clean -fd
echo ""
echo "tasks.txt contents:"
cat tasks.txt 2>/dev/null || echo "(no tasks.txt found)"
echo ""
# Return to agent directory and run
cd "$(dirname "$0")"
echo "Starting agent..."
python agent_night_shift.py --project-dir "$PROJECT_DIR" > "$LOG_FILE" 2>&1 &
AGENT_PID=$!
echo "Agent started with PID $AGENT_PID"
echo "Log file: $LOG_FILE"
echo ""
echo "Tailing log (Ctrl+C to stop watching, agent continues in background)..."
echo "============================================================"
sleep 2
tail -f "$LOG_FILE"