feat(orchestrator): bash port of pa-start / sa-start launchers#3
Closed
evannadeau wants to merge 1 commit into
Closed
feat(orchestrator): bash port of pa-start / sa-start launchers#3evannadeau wants to merge 1 commit into
evannadeau wants to merge 1 commit into
Conversation
Adds pa-start.sh and sa-start.sh alongside the existing .ps1 / .bat
launchers in plugins/orchestrator/skills/install-launchers/scripts/.
Users running Claude Code from a POSIX shell (WSL, Linux, macOS) can
now spawn PA/SA sessions without PowerShell interop.
Behavior parity with the .ps1 sources (current 0.30.28):
- Resume by display name: greps ~/.claude/projects/<hash>/*.jsonl for
"Session renamed to: <name>" lines, picks newest match, resolves to
UUID. Project-hash transform matches CC's own scheme (POSIX paths
reduce to s|/|-|g plus leading-dash trim — no \\ or : to handle).
- pa-start.sh singleton check: reads .orchestrator-state/agent-channel/
sessions.json via jq, finds role=prime entries with heartbeat <90s,
demotes them to subordinate, 2s Ctrl+C grace, then proceeds. jq's
fromdateiso8601 rejects fractional seconds, so the heartbeat string
is preprocessed with sub("\\.[0-9]+Z$"; "Z") before parsing.
- Env wiring: MCP_TIMEOUT=30000, ORCHESTRATOR_PROJECT_ROOT,
ORCHESTRATOR_AGENT_ROLE (+ SPAWNBOX_ alias), ORCHESTRATOR_PA_PERMISSION_RELAY=1,
ORCHESTRATOR_AGENT_NAME (when explicit) — same as .ps1.
- PA hardcodes --effort max (per 0.30.28 policy); SA exposes optional
--effort with low|medium|high|xhigh|max validation.
- Marketplace slug uses the same __ORCH_MARKETPLACE__ placeholder the
.ps1 sources use; install-launchers SKILL.md sed-substitutes it at
copy-into-project time.
Differences from .ps1 (out of scope or not applicable to bash):
- No wt.exe tab spawn / gold-tab color. POSIX shells don't have an
equivalent terminal-window manager invocation. exec claude runs in
the current shell. Users wanting a separate window run the launcher
inside their preferred terminal-emulator tab.
- No discord-start.sh (yet). The Discord plugin install + the dual
--channels / --dangerously-load-development-channels attach is
tightly coupled to the Windows-side flow. WSL/Linux users who need
Discord-ops can run discord-start.bat via interop or contribute a
.sh port.
SKILL.md updated to copy 8 files instead of 6, install -m 0755 the .sh
variants, and document the new per-platform variant guide + runtime
deps (jq + GNU coreutils for pa-start.sh's singleton check).
Tested on Ubuntu-24.04 WSL with bash 5, jq 1.7, GNU coreutils:
- bash -n syntax check: both scripts clean
- --help renders header docs
- Singleton-check jq query dry-run against a live sessions.json
correctly returns 0 fresh prime sessions when none are running
Closes the WSL-native gap operators have raised in issue threads.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Author
|
Pulling this back — we're pivoting the launcher set to Python-canonical (cross-platform parity, removes the bash/PowerShell drift this PR was trying to keep in sync). The Python rewrite will land as a fresh PR once the precursor work (a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
pa-start.shandsa-start.shalongside the existing.ps1/.batlaunchers inplugins/orchestrator/skills/install-launchers/scripts/. Users running Claude Code from a POSIX shell (WSL, Linux, macOS) can now spawn PA/SA sessions without PowerShell interop.Motivation: running
pa-start.batfrom WSL requirespowershell.exeinterop, which loses the Linux-native env (PATH, shell aliases, etc.) and adds a Windows-side handoff that's unnecessary whenclaudeitself runs perfectly in WSL bash. This PR closes that gap.Behavior parity with the
.ps1sources (0.30.28)~/.claude/projects/<hash>/*.jsonlforSession renamed to: <name>lines, picks newest match, resolves to UUID. Project-hash transform matches CC's own scheme (POSIX paths reduce tos|/|-|gplus leading-dash trim — no\or:to handle).pa-start.shsingleton check: reads.orchestrator-state/agent-channel/sessions.jsonviajq, findsrole=primeentries with heartbeat <90s, demotes them to subordinate, 2s Ctrl+C grace, then proceeds.jq'sfromdateiso8601rejects fractional seconds, so the heartbeat string is preprocessed withsub("\\.[0-9]+Z$"; "Z")before parsing.MCP_TIMEOUT=30000,ORCHESTRATOR_PROJECT_ROOT,ORCHESTRATOR_AGENT_ROLE(+SPAWNBOX_alias),ORCHESTRATOR_PA_PERMISSION_RELAY=1,ORCHESTRATOR_AGENT_NAME(when explicit) — same set as.ps1.--effort max(per 0.30.28 policy); SA exposes optional--effortwithlow|medium|high|xhigh|maxvalidation.__ORCH_MARKETPLACE__placeholder the.ps1sources use;install-launchersSKILL.mdsed-substitutes it at copy-into-project time.Differences from
.ps1(out of scope or N/A for bash)wt.exetab spawn / gold-tab color. POSIX shells don't have an equivalent terminal-window manager invocation.exec clauderuns in the current shell. Users wanting a separate window run the launcher inside their preferred terminal-emulator tab.discord-start.sh(yet). The Discord plugin install + the dual--channels/--dangerously-load-development-channelsattach is tightly coupled to the Windows-side Discord setup. WSL/Linux users who need Discord-ops can rundiscord-start.batvia interop or contribute a.shport in a follow-up.SKILL.md updates
Install workflow now copies 8 files instead of 6,
install -m 0755s the.shvariants, and documents the per-platform variant guide + runtime deps (jq+ GNU coreutils forpa-start.sh's singleton check;sa-start.shhas no deps beyond bash 4+). Usage examples block now lists both Windows and POSIX invocations.Test plan
Tested on Ubuntu-24.04 WSL with
bash 5.2.21,jq 1.7.1, GNU coreutils, against a live orchestrator MCP at 0.30.28.Verified end-to-end —
./sa-start.shinvoked from a fresh WSL terminal spawned a realclaudeprocess which booted the orchestrator MCP and registered insessions.json:{ "session_id": "d3614a60-146d-4e8a-bcd8-535d99e11ea7", "id8": "d3614a60", "role": "subordinate", "name": "SA-2026-05-11-19-50-34", "started_at": "2026-05-12T02:50:42.090Z", "last_heartbeat_at": "2026-05-12T02:51:12.146Z" }Confirms the whole chain: arg passing, env propagation to MCP, role/name registration, agent-channel heartbeat, id8 derivation.
Additional unit-level checks:
bash -nsyntax check clean on both scripts--helprenders header docssa-start.shfresh → auto-nameSA-YYYY-MM-DD-HH-MM-SS, all 7 env vars set, args in correct order (verified viaPATH-shimmedclaudethat prints what would be exec'd)sa-start.sh --name SA-foo --effort max→ name override +--effort maxappended after--namesa-start.sh --effort bogus→ validation rejects, exit 2pa-start.shfresh (no prime running) →--effort maxhardcoded in args, role=prime env, singleton check correctly no-opsjqsingleton-check query dry-run against a livesessions.jsoncorrectly returns[]when no prime is active and parses fractional-second ISO-8601 timestamps without errorNot exercised in this PR (low risk, deferred):
role=primeheartbeat. Thejqquery is verified; themv "$tmp" "$state_file"write path is straightforward. First real PA invocation against a stale-PA state will exercise it.Session renamed to:JSONL entry. The grep + ls -t logic is straightforward; first real use will exercise it.🤖 Generated with Claude Code