From ff1f006dd3a9cca1cb3330e5883a555a189bc17d Mon Sep 17 00:00:00 2001 From: Bil Kleb Date: Tue, 30 Jun 2026 17:23:04 -0400 Subject: [PATCH] Add pi agent support --- README.md | 2 +- swarmforge/scripts/swarmforge.bb | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9811502..19d6e4c 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ SwarmForge runs locally. Before starting a runnable branch, make sure the target - `git` - `tmux` - Babashka (`bb`) -- At least one configured agent backend, such as `codex`, `claude`, `copilot`, or `grok` +- At least one configured agent backend, such as `codex`, `claude`, `copilot`, `grok`, or `pi` ## Getting Started diff --git a/swarmforge/scripts/swarmforge.bb b/swarmforge/scripts/swarmforge.bb index ff4e9d3..2cf38a6 100755 --- a/swarmforge/scripts/swarmforge.bb +++ b/swarmforge/scripts/swarmforge.bb @@ -166,7 +166,7 @@ (fail! (str red "Error:" reset " Duplicate worktree '" worktree "' in " (:config-file ctx)))) (when (or (str/includes? worktree "/") (#{"." ".."} worktree)) (fail! (str red "Error:" reset " Invalid worktree '" worktree "' for role '" role "'"))) - (when-not (#{"claude" "codex" "copilot" "grok"} agent) + (when-not (#{"claude" "codex" "copilot" "grok" "pi"} agent) (fail! (str red "Error:" reset " Unsupported agent '" agent "' for role '" role "'"))) (when-not (#{"task" "batch"} receive-mode) (fail! (str red "Error:" reset " Invalid receive mode '" receive-mode "' for role '" role "' on line " line-no ": expected task or batch"))) @@ -339,7 +339,8 @@ "claude" (str "claude --append-system-prompt-file " (sq (str prompt-file)) " --permission-mode acceptEdits -n " (sq (str "SwarmForge " display)) " " (extra-args-prefix row) "\"$(cat " (sq (str prompt-file)) ")\"") "codex" (str "codex -C " (sq (str role-worktree)) " " (extra-args-prefix row) "\"$(cat " (sq (str prompt-file)) ")\"") "copilot" (str "copilot -C " (sq (str role-worktree)) " --name " (sq (str "SwarmForge " display)) " " (extra-args-prefix row) "-i \"$(cat " (sq (str prompt-file)) ")\"") - "grok" (str "grok --cwd " (sq (str role-worktree)) " " (grok-permission-prefix row) (extra-args-prefix row) "--rules \"$(cat " (sq (str prompt-file)) ")\" --verbatim \"$(cat " (sq (str prompt-file)) ")\""))) + "grok" (str "grok --cwd " (sq (str role-worktree)) " " (grok-permission-prefix row) (extra-args-prefix row) "--rules \"$(cat " (sq (str prompt-file)) ")\" --verbatim \"$(cat " (sq (str prompt-file)) ")\"") + "pi" (str "pi --name " (sq (str "SwarmForge " display)) " --no-context-files " (extra-args-prefix row) "\"$(cat " (sq (str prompt-file)) ")\""))) (= index 0) (str "; exit_code=$?; SWARMFORGE_TERMINAL_BACKEND=" (sq (:terminal-backend ctx)) " nohup " (sq (str (fs/path (:script-dir ctx) "swarm-cleanup.sh")))