diff options
| author | Ben Sima <ben@bensima.com> | 2025-11-24 13:59:34 -0500 |
|---|---|---|
| committer | Ben Sima <ben@bensima.com> | 2025-11-24 13:59:34 -0500 |
| commit | ea466775a6b12dce67b789aa98d2c40a9c913a97 (patch) | |
| tree | cf021707fc1afb974ae5d4ff582273ca5a0b1659 /Omni/Agent/start-worker.sh | |
| parent | 5ddaf58a46c832b2f937cebac1ec2a9368bd51e9 (diff) | |
Simplify agent command
I think the cd'ing and stuff was messing with the direnv assumptions.
Diffstat (limited to 'Omni/Agent/start-worker.sh')
| -rwxr-xr-x | Omni/Agent/start-worker.sh | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/Omni/Agent/start-worker.sh b/Omni/Agent/start-worker.sh deleted file mode 100755 index 457c83c..0000000 --- a/Omni/Agent/start-worker.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env bash -set -e - -# Omni/Agent/start-worker.sh -# Launches an Amp worker agent in the specified worktree in a loop. -# Usage: ./Omni/Agent/start-worker.sh [worker-directory-name-or-path] -# Example: ./Omni/Agent/start-worker.sh omni-worker-1 - -TARGET="${1:-omni-worker-1}" - -# 1. Find the Main Repo (where node_modules lives) -# The first worktree listed is always the main one -MAIN_REPO="$(git worktree list --porcelain | grep '^worktree ' | head -n 1 | cut -d ' ' -f 2)" -AMP_BIN="$MAIN_REPO/node_modules/.bin/amp" -TASK_BIN="$MAIN_REPO/_/bin/task" - -# 2. Resolve Worker Path -if [ -d "$TARGET" ]; then - WORKER_PATH="$(realpath "$TARGET")" -elif [ -d "$MAIN_REPO/../$TARGET" ]; then - WORKER_PATH="$(realpath "$MAIN_REPO/../$TARGET")" -else - echo "Error: Worker directory for '$TARGET' not found." - exit 1 -fi - -if [ ! -x "$AMP_BIN" ]; then - echo "Error: Amp binary not found at '$AMP_BIN'." - exit 1 -fi - -# Ensure task binary is built/available -if [ ! -x "$TASK_BIN" ]; then - echo "Warning: Task binary not found at '$TASK_BIN'. Assuming it's in path or build it first." -fi - -# Ensure worker has local task and agent binaries -mkdir -p "$WORKER_PATH/_/bin" - -echo "Syncing worker repo..." -if ! (cd "$WORKER_PATH" && git sync); then - echo "Error: Failed to run 'git sync' in worker directory." - exit 1 -fi - -echo "Building 'task' in worker..." -if ! (cd "$WORKER_PATH" && bild Omni/Task.hs); then - echo "Error: Failed to build 'task' in worker directory." - exit 1 -fi - -echo "Building 'agent' in worker..." -if ! (cd "$WORKER_PATH" && bild Omni/Agent.hs); then - echo "Error: Failed to build 'agent' in worker directory." - exit 1 -fi - -echo "Starting Worker Agent (Haskell)" -echo " Worker Path: $WORKER_PATH" -echo " Agent Bin: $WORKER_PATH/_/bin/agent" -echo " Log File: $WORKER_PATH/_/llm/amp.log" -echo " Monitor: ./Omni/Agent/monitor.sh $TARGET" -echo " Press Ctrl+C to stop." - -# Add amp to PATH so the agent can find it -export PATH="$MAIN_REPO/node_modules/.bin:$PATH" - -# Run the agent -"$WORKER_PATH/_/bin/agent" start "$TARGET" --path "$WORKER_PATH" |
