From 333a35957d1c474e9b94d2c63a7102ca197c03f7 Mon Sep 17 00:00:00 2001 From: masa6161 <14049926+masa6161@users.noreply.github.com> Date: Mon, 6 Jul 2026 11:09:34 +0900 Subject: [PATCH 1/3] fix(spawn): explicit bash invocation for psmux on Windows (#335) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit psmux (Windows tmux-compatible multiplexer) hands the split-window / new-window command token to CreateProcess/ShellExecute. An extensionless boot script has no file association, so Windows shows an "Open with" dialog instead of executing it — the agent never starts. PR #329 gated the .command rename to Darwin (#282) but assumed tmux would honor the shebang ("runs it via its shebang (tmux)"). This holds for Unix tmux but not psmux: the root cause was left unaddressed and the symptom changed from Notepad to the "Open with" dialog. Prefix `bash -l` on Windows (MINGW/MSYS/CYGWIN) in launch_in_tmux(), matching launch_windows_terminal's existing `wt.exe new-tab bash -l` pattern. Applied to both new-window and split-window branches. macOS/Linux unchanged. Tested on psmux v3.3.4 + Windows 11: - codex spawn (default-shell=bash): OK - codex spawn (default-shell=pwsh): OK - claude-code spawn (default-shell=bash): OK Co-Authored-By: Claude Opus 4.6 (1M context) --- scripts/spawn.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/spawn.sh b/scripts/spawn.sh index 29e80b85..3d864062 100755 --- a/scripts/spawn.sh +++ b/scripts/spawn.sh @@ -437,13 +437,23 @@ launch_in_tmux() { # the boot script's filename (boot-XXXXXX). `automatic-rename off` keeps the # name from being clobbered once the boot script runs the CLI / drops to a # shell. + # On Windows (MSYS2/Git Bash + psmux), tmux hands the command token to + # CreateProcess/ShellExecute. An extensionless boot script has no file + # association, so Windows shows an "Open with" dialog instead of executing + # it (#282 follow-up). Prefix `bash -l` so the interpreter is an .exe + # Windows can resolve — matches launch_windows_terminal's pattern. + local boot_argv=("$BOOT") + case "$(uname -s)" in + MINGW*|MSYS*|CYGWIN*) boot_argv=(bash -l "$BOOT") ;; + esac + local target_id if [ "$TMUX_TARGET" = "window" ]; then - target_id="$(tmux new-window -P -F '#{window_id}' -n "$NAME" -c "$PROJECT" "$BOOT")" + target_id="$(tmux new-window -P -F '#{window_id}' -n "$NAME" -c "$PROJECT" "${boot_argv[@]}")" tmux set-window-option -t "$target_id" automatic-rename off 2>/dev/null || true else local dir="-h"; [ "$SPLIT" = "v" ] && dir="-v" - target_id="$(tmux split-window "$dir" -P -F '#{pane_id}' -c "$PROJECT" "$BOOT")" + target_id="$(tmux split-window "$dir" -P -F '#{pane_id}' -c "$PROJECT" "${boot_argv[@]}")" tmux select-pane -t "$target_id" -T "$NAME" 2>/dev/null || true fi # Record placement so `despawn --force` can tear this member down even if its From 982e868f14cad9a338c2c34f64e6da242b433449 Mon Sep 17 00:00:00 2001 From: masa6161 <14049926+masa6161@users.noreply.github.com> Date: Mon, 6 Jul 2026 12:10:56 +0900 Subject: [PATCH 2/3] Revert "fix(spawn): explicit bash invocation for psmux on Windows (#335)" This reverts commit 333a35957d1c474e9b94d2c63a7102ca197c03f7. --- scripts/spawn.sh | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/scripts/spawn.sh b/scripts/spawn.sh index 3d864062..29e80b85 100755 --- a/scripts/spawn.sh +++ b/scripts/spawn.sh @@ -437,23 +437,13 @@ launch_in_tmux() { # the boot script's filename (boot-XXXXXX). `automatic-rename off` keeps the # name from being clobbered once the boot script runs the CLI / drops to a # shell. - # On Windows (MSYS2/Git Bash + psmux), tmux hands the command token to - # CreateProcess/ShellExecute. An extensionless boot script has no file - # association, so Windows shows an "Open with" dialog instead of executing - # it (#282 follow-up). Prefix `bash -l` so the interpreter is an .exe - # Windows can resolve — matches launch_windows_terminal's pattern. - local boot_argv=("$BOOT") - case "$(uname -s)" in - MINGW*|MSYS*|CYGWIN*) boot_argv=(bash -l "$BOOT") ;; - esac - local target_id if [ "$TMUX_TARGET" = "window" ]; then - target_id="$(tmux new-window -P -F '#{window_id}' -n "$NAME" -c "$PROJECT" "${boot_argv[@]}")" + target_id="$(tmux new-window -P -F '#{window_id}' -n "$NAME" -c "$PROJECT" "$BOOT")" tmux set-window-option -t "$target_id" automatic-rename off 2>/dev/null || true else local dir="-h"; [ "$SPLIT" = "v" ] && dir="-v" - target_id="$(tmux split-window "$dir" -P -F '#{pane_id}' -c "$PROJECT" "${boot_argv[@]}")" + target_id="$(tmux split-window "$dir" -P -F '#{pane_id}' -c "$PROJECT" "$BOOT")" tmux select-pane -t "$target_id" -T "$NAME" 2>/dev/null || true fi # Record placement so `despawn --force` can tear this member down even if its From 03459f1fedd1b5515fde866a592d179eb70034de Mon Sep 17 00:00:00 2001 From: masa6161 <14049926+masa6161@users.noreply.github.com> Date: Thu, 16 Jul 2026 13:57:39 +0900 Subject: [PATCH 3/3] fix(templates): add Shell requirement to all type templates (#345) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #363 added a "Shell requirement" paragraph to the root SKILL.md, instructing agents to invoke agmsg scripts via bash rather than PowerShell. However, install.sh generates the deployed SKILL.md from per-type templates (scripts/drivers/types/*/template.md) via sed, so the root SKILL.md is never installed — the instruction was silently lost on every install/update. Add the same paragraph to all nine type templates so that every `install.sh --update` produces a SKILL.md that contains the bash execution requirement. Co-Authored-By: Claude Opus 4.6 (1M context) --- scripts/drivers/types/antigravity/template.md | 2 ++ scripts/drivers/types/claude-code/template.md | 2 ++ scripts/drivers/types/codex/template.md | 2 ++ scripts/drivers/types/copilot/template.md | 2 ++ scripts/drivers/types/cursor/template.md | 2 ++ scripts/drivers/types/gemini/template.md | 2 ++ scripts/drivers/types/grok-build/template.md | 2 ++ scripts/drivers/types/hermes/template.md | 2 ++ scripts/drivers/types/opencode/template.md | 2 ++ 9 files changed, 18 insertions(+) diff --git a/scripts/drivers/types/antigravity/template.md b/scripts/drivers/types/antigravity/template.md index ec82af66..5659f822 100644 --- a/scripts/drivers/types/antigravity/template.md +++ b/scripts/drivers/types/antigravity/template.md @@ -5,6 +5,8 @@ description: Cross-agent messaging via SQLite. Send messages between Claude Code Agent messaging command. **IMPORTANT: Always use the provided scripts. NEVER directly read or edit config files, DB, or team data. There is NO register.sh — use join.sh to join a team.** +**Shell requirement:** All agmsg scripts are Bash scripts. Always execute them via `bash`, never via PowerShell or cmd directly. If your default shell is not Bash (e.g. PowerShell on Windows), wrap every command with `bash -lc '...'`. Example: `bash -lc '~/.agents/skills/__SKILL_NAME__/scripts/send.sh myteam alice bob "hello"'`. Do NOT construct DB paths manually — the scripts handle path resolution internally. If you need to redirect storage, use `AGMSG_STORAGE_PATH` (the supported override). + ## Identity If you already know your AGENT and TEAMS from a previous `$__SKILL_NAME__` call in this session, skip to **Execute** below. diff --git a/scripts/drivers/types/claude-code/template.md b/scripts/drivers/types/claude-code/template.md index e0c41547..23ab8517 100644 --- a/scripts/drivers/types/claude-code/template.md +++ b/scripts/drivers/types/claude-code/template.md @@ -4,6 +4,8 @@ description: Agent messaging — check inbox, send messages, view history Agent messaging command. **IMPORTANT: Always use the provided scripts. NEVER directly read or edit config files, DB, or team data. There is NO register.sh — use join.sh to join a team.** +**Shell requirement:** All agmsg scripts are Bash scripts. Always execute them via `bash`, never via PowerShell or cmd directly. If your default shell is not Bash (e.g. PowerShell on Windows), wrap every command with `bash -lc '...'`. Example: `bash -lc '~/.agents/skills/__SKILL_NAME__/scripts/send.sh myteam alice bob "hello"'`. Do NOT construct DB paths manually — the scripts handle path resolution internally. If you need to redirect storage, use `AGMSG_STORAGE_PATH` (the supported override). + ## Identity If you already know your AGENT and TEAMS from a previous `/__SKILL_NAME__` call in this session, skip to **Execute** below. diff --git a/scripts/drivers/types/codex/template.md b/scripts/drivers/types/codex/template.md index 8dcf1195..6335bd85 100644 --- a/scripts/drivers/types/codex/template.md +++ b/scripts/drivers/types/codex/template.md @@ -5,6 +5,8 @@ description: Cross-agent messaging via SQLite. Send messages between Claude Code Agent messaging command. **IMPORTANT: Always use the provided scripts. NEVER directly read or edit config files, DB, or team data. There is NO register.sh — use join.sh to join a team.** +**Shell requirement:** All agmsg scripts are Bash scripts. Always execute them via `bash`, never via PowerShell or cmd directly. If your default shell is not Bash (e.g. PowerShell on Windows), wrap every command with `bash -lc '...'`. Example: `bash -lc '~/.agents/skills/__SKILL_NAME__/scripts/send.sh myteam alice bob "hello"'`. Do NOT construct DB paths manually — the scripts handle path resolution internally. If you need to redirect storage, use `AGMSG_STORAGE_PATH` (the supported override). + ## Identity If you already know your AGENT and TEAMS from a previous `$__SKILL_NAME__` call in this session, skip to **Execute** below. diff --git a/scripts/drivers/types/copilot/template.md b/scripts/drivers/types/copilot/template.md index a5709643..3b0c6826 100644 --- a/scripts/drivers/types/copilot/template.md +++ b/scripts/drivers/types/copilot/template.md @@ -5,6 +5,8 @@ description: Cross-agent messaging via SQLite. Send messages between Claude Code Agent messaging command. **IMPORTANT: Always use the provided scripts. NEVER directly read or edit config files, DB, or team data. There is NO register.sh — use join.sh to join a team.** +**Shell requirement:** All agmsg scripts are Bash scripts. Always execute them via `bash`, never via PowerShell or cmd directly. If your default shell is not Bash (e.g. PowerShell on Windows), wrap every command with `bash -lc '...'`. Example: `bash -lc '~/.agents/skills/__SKILL_NAME__/scripts/send.sh myteam alice bob "hello"'`. Do NOT construct DB paths manually — the scripts handle path resolution internally. If you need to redirect storage, use `AGMSG_STORAGE_PATH` (the supported override). + ## Identity If you already know your AGENT and TEAMS from a previous `/__SKILL_NAME__` call in this session, skip to **Execute** below. diff --git a/scripts/drivers/types/cursor/template.md b/scripts/drivers/types/cursor/template.md index 59602189..bb1f15bf 100644 --- a/scripts/drivers/types/cursor/template.md +++ b/scripts/drivers/types/cursor/template.md @@ -5,6 +5,8 @@ description: Cross-agent messaging via SQLite. Send messages between Claude Code Agent messaging command. **IMPORTANT: Always use the provided scripts. NEVER directly read or edit config files, DB, or team data. There is NO register.sh — use join.sh to join a team.** +**Shell requirement:** All agmsg scripts are Bash scripts. Always execute them via `bash`, never via PowerShell or cmd directly. If your default shell is not Bash (e.g. PowerShell on Windows), wrap every command with `bash -lc '...'`. Example: `bash -lc '~/.agents/skills/__SKILL_NAME__/scripts/send.sh myteam alice bob "hello"'`. Do NOT construct DB paths manually — the scripts handle path resolution internally. If you need to redirect storage, use `AGMSG_STORAGE_PATH` (the supported override). + ## Identity If you already know your AGENT and TEAMS from a previous `$__SKILL_NAME__` call in this session, skip to **Execute** below. diff --git a/scripts/drivers/types/gemini/template.md b/scripts/drivers/types/gemini/template.md index 92488f94..0d532ff1 100644 --- a/scripts/drivers/types/gemini/template.md +++ b/scripts/drivers/types/gemini/template.md @@ -5,6 +5,8 @@ description: Cross-agent messaging via SQLite. Send messages between Claude Code Agent messaging command. **IMPORTANT: Always use the provided scripts. NEVER directly read or edit config files, DB, or team data. There is NO register.sh — use join.sh to join a team.** +**Shell requirement:** All agmsg scripts are Bash scripts. Always execute them via `bash`, never via PowerShell or cmd directly. If your default shell is not Bash (e.g. PowerShell on Windows), wrap every command with `bash -lc '...'`. Example: `bash -lc '~/.agents/skills/__SKILL_NAME__/scripts/send.sh myteam alice bob "hello"'`. Do NOT construct DB paths manually — the scripts handle path resolution internally. If you need to redirect storage, use `AGMSG_STORAGE_PATH` (the supported override). + ## Identity If you already know your AGENT and TEAMS from a previous `$__SKILL_NAME__` call in this session, skip to **Execute** below. diff --git a/scripts/drivers/types/grok-build/template.md b/scripts/drivers/types/grok-build/template.md index 75756d57..903b9fa8 100644 --- a/scripts/drivers/types/grok-build/template.md +++ b/scripts/drivers/types/grok-build/template.md @@ -5,6 +5,8 @@ description: Cross-agent messaging via SQLite. Send messages between Claude Code Agent messaging command. **IMPORTANT: Always use the provided scripts. NEVER directly read or edit config files, DB, or team data. There is NO register.sh — use join.sh to join a team.** +**Shell requirement:** All agmsg scripts are Bash scripts. Always execute them via `bash`, never via PowerShell or cmd directly. If your default shell is not Bash (e.g. PowerShell on Windows), wrap every command with `bash -lc '...'`. Example: `bash -lc '~/.agents/skills/__SKILL_NAME__/scripts/send.sh myteam alice bob "hello"'`. Do NOT construct DB paths manually — the scripts handle path resolution internally. If you need to redirect storage, use `AGMSG_STORAGE_PATH` (the supported override). + ## Identity If you already know your AGENT and TEAMS from a previous `/__SKILL_NAME__` call in this session, skip to **Execute** below. diff --git a/scripts/drivers/types/hermes/template.md b/scripts/drivers/types/hermes/template.md index 19a5b9c1..54506cd2 100644 --- a/scripts/drivers/types/hermes/template.md +++ b/scripts/drivers/types/hermes/template.md @@ -5,6 +5,8 @@ description: Cross-agent messaging via SQLite. Send messages between Claude Code Hermes Agent skill for agmsg cross-agent messaging. **IMPORTANT: Always use the provided scripts. NEVER directly read or edit config files, DB, or team data. There is NO register.sh — use join.sh to join a team.** +**Shell requirement:** All agmsg scripts are Bash scripts. Always execute them via `bash`, never via PowerShell or cmd directly. If your default shell is not Bash (e.g. PowerShell on Windows), wrap every command with `bash -lc '...'`. Example: `bash -lc '~/.agents/skills/__SKILL_NAME__/scripts/send.sh myteam alice bob "hello"'`. Do NOT construct DB paths manually — the scripts handle path resolution internally. If you need to redirect storage, use `AGMSG_STORAGE_PATH` (the supported override). + ## Identity If you already know your AGENT and TEAMS from a previous `/__SKILL_NAME__` use in this session, skip to **Execute** below. diff --git a/scripts/drivers/types/opencode/template.md b/scripts/drivers/types/opencode/template.md index d263bfdd..1b1f42dd 100644 --- a/scripts/drivers/types/opencode/template.md +++ b/scripts/drivers/types/opencode/template.md @@ -5,6 +5,8 @@ description: Cross-agent messaging via SQLite. Send messages between Claude Code Agent messaging command. **IMPORTANT: Always use the provided scripts. NEVER directly read or edit config files, DB, or team data. There is NO register.sh — use join.sh to join a team.** +**Shell requirement:** All agmsg scripts are Bash scripts. Always execute them via `bash`, never via PowerShell or cmd directly. If your default shell is not Bash (e.g. PowerShell on Windows), wrap every command with `bash -lc '...'`. Example: `bash -lc '~/.agents/skills/__SKILL_NAME__/scripts/send.sh myteam alice bob "hello"'`. Do NOT construct DB paths manually — the scripts handle path resolution internally. If you need to redirect storage, use `AGMSG_STORAGE_PATH` (the supported override). + ## Identity If you already know your AGENT and TEAMS from a previous `$__SKILL_NAME__` call in this session, skip to **Execute** below.