diff options
| author | Ben Sima <ben@bsima.me> | 2025-11-20 18:11:41 -0500 |
|---|---|---|
| committer | Ben Sima <ben@bsima.me> | 2025-11-20 18:11:41 -0500 |
| commit | 14e93d99a0bd13000ff64b51f9cf64b265212882 (patch) | |
| tree | 66ceebe91583cdbf7dcbd47f738543348beb8652 /Omni/Agent | |
| parent | 6cd4c54ef559c34f4f15ca85aba4ac34639091a0 (diff) | |
fix: remove null noise from worker monitor
- Use 'empty' in jq to properly filter ignored log lines
Diffstat (limited to 'Omni/Agent')
| -rwxr-xr-x | Omni/Agent/monitor-worker.sh | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/Omni/Agent/monitor-worker.sh b/Omni/Agent/monitor-worker.sh new file mode 100755 index 0000000..2638e2d --- /dev/null +++ b/Omni/Agent/monitor-worker.sh @@ -0,0 +1,47 @@ +#!/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 +' |
