diff --git a/.agents/skills/multi-agent-mux-create/scripts/create_session.sh b/.agents/skills/multi-agent-mux-create/scripts/create_session.sh index b9a859b..455757e 100755 --- a/.agents/skills/multi-agent-mux-create/scripts/create_session.sh +++ b/.agents/skills/multi-agent-mux-create/scripts/create_session.sh @@ -148,11 +148,29 @@ if [ -n "$ISOLATION_ROOT" ]; then ISO_ENV_PREFIX="$(isolation_env_prefix "$AGENT" "$ISOLATION_ROOT")" ISO_CMD_ARGS="$(isolation_cmd_args "$AGENT" "$ISOLATION_ROOT")" fi + +# Resolve absolute path of the agent command to prevent tmux PATH inheritance issues (especially on macOS) +RESOLVED_BIN="$AGENT" +if [ "$AGENT" = "cline" ]; then + if command -v cline >/dev/null 2>&1; then + RESOLVED_BIN="$(command -v cline)" + fi +else + if command -v "$AGENT" >/dev/null 2>&1; then + RESOLVED_BIN="$(command -v "$AGENT")" + fi +fi + +# On macOS, clear quarantine attribute for the agent binary to prevent Gatekeeper hangs +if [ "$(uname)" = "Darwin" ] && [ -f "$RESOLVED_BIN" ]; then + xattr -d com.apple.quarantine "$RESOLVED_BIN" 2>/dev/null || true +fi + case "$AGENT" in - claude) CMD_FULL="${ISO_ENV_PREFIX}claude --dangerously-skip-permissions" ;; - agy) CMD_FULL="${ISO_ENV_PREFIX}agy --dangerously-skip-permissions" ;; - hermes) CMD_FULL="${ISO_ENV_PREFIX}hermes" ;; - cline) CMD_FULL="cline -i${ISO_CMD_ARGS:+ $ISO_CMD_ARGS}" ;; + claude) CMD_FULL="${ISO_ENV_PREFIX}${RESOLVED_BIN} --dangerously-skip-permissions" ;; + agy) CMD_FULL="${ISO_ENV_PREFIX}${RESOLVED_BIN} --dangerously-skip-permissions" ;; + hermes) CMD_FULL="${ISO_ENV_PREFIX}${RESOLVED_BIN}" ;; + cline) CMD_FULL="${RESOLVED_BIN} -i${ISO_CMD_ARGS:+ $ISO_CMD_ARGS}" ;; esac spawn() { diff --git a/.agents/skills/multi-agent-mux-resume/scripts/resume_session.sh b/.agents/skills/multi-agent-mux-resume/scripts/resume_session.sh index 6dfd038..294d663 100755 --- a/.agents/skills/multi-agent-mux-resume/scripts/resume_session.sh +++ b/.agents/skills/multi-agent-mux-resume/scripts/resume_session.sh @@ -87,12 +87,29 @@ if [ -n "$ISO_ROOT" ]; then echo "Re-applying isolation: root=$ISO_ROOT env=$ISO_ENV args=$ISO_ARGS" fi +# Resolve absolute path of the agent command to prevent tmux PATH inheritance issues (especially on macOS) +RESOLVED_BIN="$AGENT" +if [ "$AGENT" = "cline" ]; then + if command -v cline >/dev/null 2>&1; then + RESOLVED_BIN="$(command -v cline)" + fi +else + if command -v "$AGENT" >/dev/null 2>&1; then + RESOLVED_BIN="$(command -v "$AGENT")" + fi +fi + +# On macOS, clear quarantine attribute for the agent binary to prevent Gatekeeper hangs +if [ "$(uname)" = "Darwin" ] && [ -f "$RESOLVED_BIN" ]; then + xattr -d com.apple.quarantine "$RESOLVED_BIN" 2>/dev/null || true +fi + # Determine CMD_FULL with isolation applied case "$AGENT" in - claude) CMD_FULL="claude --dangerously-skip-permissions -r $UUID" ;; - agy) CMD_FULL="agy --dangerously-skip-permissions --conversation $UUID" ;; - hermes) CMD_FULL="hermes --resume $UUID" ;; - cline) CMD_FULL="cline -i --id $UUID" ;; + claude) CMD_FULL="${RESOLVED_BIN} --dangerously-skip-permissions -r $UUID" ;; + agy) CMD_FULL="${RESOLVED_BIN} --dangerously-skip-permissions --conversation $UUID" ;; + hermes) CMD_FULL="${RESOLVED_BIN} --resume $UUID" ;; + cline) CMD_FULL="${RESOLVED_BIN} -i --id $UUID" ;; esac # Prepend env prefix and append command args (T4)