summaryrefslogtreecommitdiff
path: root/Omni/Agent/monitor.sh
blob: 1626354575735777568c85ffdd81a1318e58a5e6 (plain)
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
#!/usr/bin/env bash
# Omni/Agent/monitor.sh
# Monitor the logs of a worker agent
# Usage: ./Omni/Agent/monitor.sh [worker-name]

WORKER="${1:-omni-worker-1}"
REPO_ROOT="$(git rev-parse --show-toplevel)"
WORKER_DIR="$REPO_ROOT/../$WORKER"

if [ ! -d "$WORKER_DIR" ]; then
    echo "Error: Worker directory '$WORKER_DIR' not found."
    echo "Usage: $0 [worker-name]"
    exit 1
fi

LOG_FILE="$WORKER_DIR/_/llm/amp.log"

echo "Monitoring worker: $WORKER"
echo "Watching log: $LOG_FILE"
echo "---------------------------------------------------"

# Wait for log file to appear
while [ ! -f "$LOG_FILE" ]; do
    echo "Waiting for log file to be created..."
    sleep 2
done

# Tail the log file
tail -f "$LOG_FILE"