feat: add optional tmux launcher workflow#7
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an optional tmux-based launcher workflow around the existing squad CLI to support repeatable multi-agent launches (including worktree mode), along with templates, shell-based tests, and CI coverage for the launcher on Unix runners.
Changes:
- Add
scripts/squad-tmux-launch.sh+ helper library to generate prompts/summaries/maps and optionally orchestrate tmux + git worktrees. - Add example config/task templates and shell tests (helpers unit-style + end-to-end dry-run smoke).
- Document the optional launcher in READMEs and run launcher shell tests in CI (non-Windows).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/squad-tmux-launch.sh |
Main tmux launcher script: parses config, generates artifacts, optionally creates worktree, orchestrates tmux panes + prompt injection. |
scripts/lib/squad-tmux-launcher-helpers.sh |
Shared helper functions for shell escaping, command detection, path/worktree handling. |
tests/squad_tmux_launcher_helpers_test.sh |
Shell tests for helper functions (command candidate detection, truthy parsing, worktree planning/creation). |
tests/squad_tmux_launcher_smoke.sh |
End-to-end dry-run smoke test validating generated prompt/summary/map artifacts. |
templates/launcher.yaml.example |
Example launcher config template. |
templates/run-task.md.example |
Example task brief template. |
README.md |
Documents the optional tmux launcher and requirements. |
README.zh-CN.md |
Chinese documentation for the optional tmux launcher and requirements. |
.github/workflows/ci.yml |
Runs the new shell tests on Unix GitHub Actions runners. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| require "shellwords" | ||
|
|
||
| file = ARGV[0] | ||
| data = File.exist?(file) ? (YAML.load_file(file) || {}) : {} |
There was a problem hiding this comment.
The embedded Ruby config loader uses YAML.load_file, which is unsafe for untrusted YAML (it can deserialize arbitrary Ruby objects). Switch to YAML.safe_load (aliases disabled and a minimal permitted class list) to avoid object-injection risk when running the launcher in arbitrary repos.
| data = File.exist?(file) ? (YAML.load_file(file) || {}) : {} | |
| data = | |
| if File.exist?(file) | |
| content = File.read(file) | |
| YAML.safe_load( | |
| content, | |
| permitted_classes: [], | |
| permitted_symbols: [], | |
| aliases: false | |
| ) || {} | |
| else | |
| {} | |
| end |
| set +u | ||
| printf '%s\n' "${candidates[@]}" | ||
| set -u | ||
| } |
There was a problem hiding this comment.
pane_command_candidates also toggles nounset at function exit (set +u / set -u) which can change the caller’s shell options permanently. Restore the original nounset setting instead of forcing set -u here.
| if (( no_setup == 0 )); then | ||
| echo "[1/5] Refreshing Claude /squad command" | ||
| squad setup claude | ||
| else | ||
| echo "[1/5] Skipping squad setup claude (--no-setup)" |
There was a problem hiding this comment.
The progress logging counters are inconsistent ([1/5] here but later steps are labeled [4/6], [5/6], [6/6]). Update the earlier messages to match the actual total step count so users don’t get confusing output when troubleshooting.
| set +u | ||
| for existing in "${candidates[@]}"; do | ||
| if [[ "$existing" == "$candidate" ]]; then | ||
| found=1 | ||
| break |
There was a problem hiding this comment.
These helpers call set +u / set -u inside a function. Because set is global, sourcing this library from a shell that didn’t enable nounset will end up enabling -u for the rest of the session. Save/restore the prior nounset state (or avoid changing shell options inside helpers).
|
@tt-a1i hi, pls take a look |
Thank you, LGTM |
|
you Chinese? can we add wechat: aias00 |
Summary
scripts/squad-tmux-launch.shhelper for repeatable tmux-based multi-agent launchesDetails
This keeps the core Rust CLI unchanged and treats the launcher as opt-in automation for people who already use Claude Code + tmux.
Notable safety changes in the launcher:
squad agents --jsonbefore injecting manager / inspector promptsVerification
bash -n scripts/squad-tmux-launch.shbash -n scripts/lib/squad-tmux-launcher-helpers.shbash tests/squad_tmux_launcher_helpers_test.shbash tests/squad_tmux_launcher_smoke.shcargo test --all