summaryrefslogtreecommitdiff
path: root/Omni/Agent/monitor-worker.sh
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-11-22 13:42:24 -0500
committerBen Sima <ben@bensima.com>2025-11-22 13:54:41 -0500
commit326309f82408eb29c520ec83cff9bf66c9dd780a (patch)
tree4cf9ba641d2673b81a83702b32498ff75c4e89f0 /Omni/Agent/monitor-worker.sh
parent8697fd8a11a1cf368db1e6c05afddf87906e8de3 (diff)
feat: implement t-rWcqsDZFM.3
Consolidated `monitor.sh` and `monitor-worker.sh` into a single `monitor.sh` script. 1. Updated `Omni/Agent/monitor.sh`: - Default behavior now uses `jq` to filter logs (formerly `monitor-worker.sh` behavior). - Added `--raw` flag to support raw log tailing (original `monitor.sh` behavior). - Accepts worker name as an argument (e.g., `./monitor.sh --raw omni-worker-2`). 2. Deleted `Omni/Agent/monitor-worker.sh`. 3. Updated `Omni/Agent/DESIGN.md` to reference the consolidated script. 4. Verified syntax of the new script. 5. Ran tests for `Omni/Agent.hs` (passed). The new usage for `monitor.sh` is: ```bash ./Omni/Agent/monitor.sh [worker-name] # Formatted output (default) ./Omni/Agent/monitor.sh --raw [worker-name] # Raw output ```
Diffstat (limited to 'Omni/Agent/monitor-worker.sh')
-rwxr-xr-xOmni/Agent/monitor-worker.sh47
1 files changed, 0 insertions, 47 deletions
diff --git a/Omni/Agent/monitor-worker.sh b/Omni/Agent/monitor-worker.sh
deleted file mode 100755
index 2638e2d..0000000
--- a/Omni/Agent/monitor-worker.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/env bash
-set -e
-
-# Omni/Agent/monitor-worker.sh
-# Monitors the worker agent's activity by filtering the debug log.
-# Usage: ./Omni/Agent/monitor-worker.sh [worker-directory-name]
-
-WORKER_NAME="${1:-omni-worker-1}"
-REPO_ROOT="$(git rev-parse --show-toplevel)"
-WORKER_PATH="$REPO_ROOT/../$WORKER_NAME"
-LOG_FILE="$WORKER_PATH/_/llm/amp.log"
-
-if [ ! -f "$LOG_FILE" ]; then
- echo "Waiting for log file at $LOG_FILE..."
- while [ ! -f "$LOG_FILE" ]; do sleep 1; done
-fi
-
-echo "Monitoring Worker Agent in '$WORKER_PATH'..."
-echo "Press Ctrl+C to stop."
-echo "------------------------------------------------"
-
-# Tail the log and use jq to parse/filter relevant events
-# We handle JSON parse errors gracefully (in case of partial writes)
-tail -f "$LOG_FILE" | grep --line-buffered "^{" | jq -R -r '
-try (
- fromjson |
- if .message == "executing 1 tools in 1 batch(es)" then
- "🤖 THOUGHT: Planning tool execution (" + (.batches[0][0] // "unknown") + ")"
- elif .message == "Tool Bash - checking permissions" then
- empty
- elif .message == "Tool Bash permitted - action: allow" then
- "🔧 TOOL: Bash command executed"
- elif .toolName != null and .message == "Processing tool completion for ledger" then
- "✅ TOOL: " + .toolName + " completed"
- elif .message == "ide-fs" and .method == "readFile" then
- "📂 READ: " + .path
- elif .message == "System prompt build complete (no changes)" then
- "🧠 THINKING..."
- elif .message == "System prompt build complete (first build)" then
- "🚀 STARTING new task context"
- elif .level == "error" then
- "❌ ERROR: " + .message
- else
- empty
- end
-) catch empty
-'