From 8b829647f4fd3036727bb5d272b144a18c75f554 Mon Sep 17 00:00:00 2001 From: Godopu Date: Sun, 25 Oct 2026 19:31:18 +0000 Subject: [PATCH] fix(stop): a registry that cannot be read is not "no row" (Issue #71) load_state_json printed {} on a YAML/DB read error, so a registered session was closed row-less (exit 0) and its stop workflow skipped. stop now reads the registry strictly and exits 1 before any herdr call. Pins of the shifted stop_session.sh lines updated. Refs #71 Co-Authored-By: Claude Opus 5.5 --- .../skills/multi-agent-mux-stop/scripts/stop_session.sh | 7 ++++++- tests/data/skill_code_blocks.json | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.agents/skills/multi-agent-mux-stop/scripts/stop_session.sh b/.agents/skills/multi-agent-mux-stop/scripts/stop_session.sh index c5ac9bd..3aaf352 100755 --- a/.agents/skills/multi-agent-mux-stop/scripts/stop_session.sh +++ b/.agents/skills/multi-agent-mux-stop/scripts/stop_session.sh @@ -166,7 +166,12 @@ sys.exit(0 if cwd == root or cwd.startswith(root + os.sep) else 1) # 세션이 YAML 에 있는지 + 해당 row 의 워크스페이스 cwd 및 delegate_job_id 추출. # JSON 으로 emit — cwd 에 '|' 가 들어가도 안전 (review item 7; 기존 cwd|jid 파서 대체). -MAPPED_DATA=$(MAM_STATE_JSON="$(load_state_json)" SESSION_NAME="$SESSION_NAME" python3 -c " +# A registry that cannot be read is not "no row" (Issue #71): stop before herdr. +STATE_JSON=$(load_state_json strict) || { + echo "ERROR: cannot read $AGENT_SESSIONS_YAML, so whether '$SESSION_NAME' has a row is unknown. Nothing changed." >&2 + exit 1 +} +MAPPED_DATA=$(MAM_STATE_JSON="$STATE_JSON" SESSION_NAME="$SESSION_NAME" python3 -c " import sys, os, json name = os.environ['SESSION_NAME'] d = json.loads(os.environ.get('MAM_STATE_JSON', '{}')) diff --git a/tests/data/skill_code_blocks.json b/tests/data/skill_code_blocks.json index 2a7addb..90b67e7 100644 --- a/tests/data/skill_code_blocks.json +++ b/tests/data/skill_code_blocks.json @@ -433,7 +433,7 @@ "class": "c", "kind": "diagram", "evidence": [ - "multi-agent-mux-stop/scripts/stop_session.sh:240-254" + "multi-agent-mux-stop/scripts/stop_session.sh:245-259" ], "mismatch": null, "note": "state machine" @@ -504,8 +504,8 @@ "class": "a", "evidence": [ "multi-agent-mux-stop/scripts/stop_session.sh:101", - "multi-agent-mux-stop/scripts/stop_session.sh:123-188", - "multi-agent-mux-stop/scripts/stop_session.sh:240-244" + "multi-agent-mux-stop/scripts/stop_session.sh:123-193", + "multi-agent-mux-stop/scripts/stop_session.sh:245-249" ], "mismatch": [ "T1: the doc offered --force-no-yaml, which no script accepts" @@ -601,7 +601,7 @@ "other" ], "passthrough": { - "1": "multi-agent-mux-stop/scripts/stop_session.sh:379" + "1": "multi-agent-mux-stop/scripts/stop_session.sh:384" } }, "multi-agent-mux-create/scripts/create_session.sh": {