From 0fe3b9932cac0d8415dd187ea25588494e7b0973 Mon Sep 17 00:00:00 2001 From: Godopu Date: Wed, 5 Aug 2026 10:13:46 +0900 Subject: [PATCH] fix(refactor): remove tracked tmp file, add *.tmp to gitignore, fix herdr_session lookup in reconcile.sh MQTT handler --- .agents/skills/lib.sh | 4 +- .../scripts/create_session.sh | 2 +- ...lti-agent-mux-delegate-job.13243_22852.tmp | 597 ------------------ .../scripts/reconcile.sh | 2 +- .gitignore | 1 + 5 files changed, 5 insertions(+), 601 deletions(-) delete mode 100755 .agents/skills/multi-agent-mux-delegate-job/multi-agent-mux-delegate-job.13243_22852.tmp diff --git a/.agents/skills/lib.sh b/.agents/skills/lib.sh index 94e71fb..0be5c73 100644 --- a/.agents/skills/lib.sh +++ b/.agents/skills/lib.sh @@ -502,8 +502,8 @@ herdr() { # --------------------------------------------------------------------------- # resolve_herdr_server # -# Query agent-sessions.yaml to find the herdr_server associated with a session. -# Fallback to HERDR_SERVER_NAME or 'default' if not registered or field is missing. +# Query agent-sessions.yaml to find the herdr_session associated with a session. +# Fallback to HERDR_SESSION_NAME or HERDR_SERVER_NAME or workspace slug or 'default' if not registered. # Prints the resolved server name on stdout. # --------------------------------------------------------------------------- load_state_json() { 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 d8bbc4a..e0b4d86 100755 --- a/.agents/skills/multi-agent-mux-create/scripts/create_session.sh +++ b/.agents/skills/multi-agent-mux-create/scripts/create_session.sh @@ -208,7 +208,7 @@ NOW_ISO=$(date -u +'%Y-%m-%dT%H:%M:%SZ') # 시작 명령 # NOTE: this must match what `spawn()` actually ran above — env-var-driven -# herdr server shim (HERDR_SERVER_NAME picked up by the lib.sh shim). +# herdr server shim (HERDR_SESSION_NAME picked up by the lib.sh shim). START_CMD="HERDR_SESSION_NAME=${HERDR_SESSION_NAME:-default} herdr new-session -d -s \"$SESSION_NAME\" -x 140 -y 40 -c \"$WORKSPACE\" \"$CMD_FULL\"" # If --onboard is specified, automatically build the onboarding prompt diff --git a/.agents/skills/multi-agent-mux-delegate-job/multi-agent-mux-delegate-job.13243_22852.tmp b/.agents/skills/multi-agent-mux-delegate-job/multi-agent-mux-delegate-job.13243_22852.tmp deleted file mode 100755 index b4307ea..0000000 --- a/.agents/skills/multi-agent-mux-delegate-job/multi-agent-mux-delegate-job.13243_22852.tmp +++ /dev/null @@ -1,597 +0,0 @@ -#!/usr/bin/env bash -# multi-agent-mux-delegate-job — user-facing orchestrator for the multi-agent-mux-delegate-job skill. -# -# Subcommands: -# submit register a job, start the subscriber FIRST, then run the agent, -# then (optionally) run a validation script. -# status show one job record. -# list list all jobs. -# verify run a user-supplied --validate script against a job's artifacts. -# wait block until all running/pending jobs reach a terminal state. -# -# This is a reference wrapper: it shells out to the python scripts that live -# next to it. Copy it into your project and customise as needed. It never hard -# fails if `claude`/`codex`/`herdr` are missing — it prints what it would run. -set -euo pipefail - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -# Load local env file (.mam.env preferred, .env fallback) from workspace root or explicit MAM_ENV_FILE -REPO_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)" -TARGET_ENV="${MAM_ENV_FILE:-}" -if [[ -z "$TARGET_ENV" ]]; then - if [[ -f "$REPO_ROOT/.mam.env" ]]; then - TARGET_ENV="$REPO_ROOT/.mam.env" - elif [[ -f "$REPO_ROOT/.env" ]]; then - TARGET_ENV="$REPO_ROOT/.env" - echo "WARNING: Loading deprecated config file '$TARGET_ENV'. Please migrate to '.mam.env'." >&2 - elif [[ -f .mam.env ]]; then - TARGET_ENV=".mam.env" - echo "WARNING: Loading config from cwd relative path '$TARGET_ENV'." >&2 - elif [[ -f .env ]]; then - TARGET_ENV=".env" - echo "WARNING: Loading deprecated config from cwd relative path '$TARGET_ENV'. Please migrate to '.mam.env'." >&2 - fi -fi - -if [[ -n "$TARGET_ENV" && -f "$TARGET_ENV" ]]; then - set -a; source "$TARGET_ENV"; set +a -fi - -# Source EARLY (before any herdr usage in run_agent) — this is what turns -# plain `herdr` into the tmux-compat shim (herdr() function) and provides -# resolve_herdr_workspace/send_keys_safe. Sourcing it late meant the -# has-session pre-flight check below used to hit the real herdr binary with -# a nonexistent subcommand and always fail. -source "$SCRIPT_DIR/../lib.sh" - -# Pick an interpreter: prefer a project .venv, else python3. -pick_python() { - local py_bin - if [[ -n "${DELEGATE_JOB_PYTHON:-}" ]]; then - py_bin="$DELEGATE_JOB_PYTHON" - elif [[ -n "${AGENT_PYTHON_BIN:-}" ]] && [[ -x "$AGENT_PYTHON_BIN" ]]; then - py_bin="$AGENT_PYTHON_BIN" - elif [[ -x "${WORKDIR:-.}/.venv/bin/python" ]]; then - py_bin="${WORKDIR}/.venv/bin/python" - elif [[ -x ".venv/bin/python" ]]; then - py_bin="$(pwd)/.venv/bin/python" - else - py_bin="python3" - fi - if ! "$py_bin" -c "import paho.mqtt" 2>/dev/null; then - echo "ERROR: paho-mqtt package is missing for $py_bin." >&2 - echo " Please create a virtual environment and install it:" >&2 - echo " python3 -m venv .venv && .venv/bin/pip install -r \"$SCRIPT_DIR/requirements.txt\"" >&2 - exit 1 - fi - echo "$py_bin" -} - -REGISTRY_DIR_DEFAULT=".mam/jobs" - -usage() { - cat <<'EOF' -multi-agent-mux-delegate-job [options] - - submit --agent --prompt [--workdir ] [--agent-session