summaryrefslogtreecommitdiff
path: root/Omni/Agent/setup-worker.sh
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2025-11-20 16:23:29 -0500
committerBen Sima <ben@bsima.me>2025-11-20 16:23:29 -0500
commitb6334da771d764b7c29b33522db06b6cc716c6cb (patch)
tree644805fb7f3276ea6a5a8af022f4b1f67c316a6f /Omni/Agent/setup-worker.sh
parent9ab85c33379f98229235a30dbf5108ad31a01d1f (diff)
feat: implement multi-agent workflow infrastructure
- Add 'Review' status to Task tool - Add Omni/Agent/ directory with setup and sync scripts - Add WORKER_AGENT_GUIDE.md - Configure custom merge driver for tasks.jsonl
Diffstat (limited to 'Omni/Agent/setup-worker.sh')
-rwxr-xr-xOmni/Agent/setup-worker.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/Omni/Agent/setup-worker.sh b/Omni/Agent/setup-worker.sh
new file mode 100755
index 0000000..27a9939
--- /dev/null
+++ b/Omni/Agent/setup-worker.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+set -e
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 <worker-name>"
+ echo "Example: $0 omni-worker-1"
+ exit 1
+fi
+
+WORKER_NAME="$1"
+REPO_ROOT="$(git rev-parse --show-toplevel)"
+WORKTREE_PATH="$REPO_ROOT/../$WORKER_NAME"
+
+echo "Creating worktree at $WORKTREE_PATH..."
+git worktree add "$WORKTREE_PATH" live
+
+# Copy .envrc.local if it exists (user-specific config)
+if [ -f "$REPO_ROOT/.envrc.local" ]; then
+ echo "Copying .envrc.local..."
+ cp "$REPO_ROOT/.envrc.local" "$WORKTREE_PATH/"
+fi
+
+# We create a new branch for the worker based on 'live'
+# This avoids the "branch already checked out" error if 'live' is checked out elsewhere
+BRANCH_NAME="${WORKER_NAME}"
+echo "Creating worktree '$WORKTREE_PATH' on branch '$BRANCH_NAME' (from live)..."
+git worktree add -b "$BRANCH_NAME" "$WORKTREE_PATH" live