fix: attach_command from one builder, no kill/start_command, row-less stop, one herdr name rule, registry format 2 (Issue #71) #73

Merged
Godopu merged 15 commits from fix/issue-71 into main 2026-10-26 22:28:51 +00:00
2 changed files with 18 additions and 6 deletions
Showing only changes of commit 263a72483a - Show all commits

No files matched your search

@@ -106,6 +106,7 @@ if [ "$PURGE" = "1" ]; then
trap 'rm -f "$WORKSPACE_ROOT/.mam/purging-$SESSION_NAME"' EXIT trap 'rm -f "$WORKSPACE_ROOT/.mam/purging-$SESSION_NAME"' EXIT
fi fi
AMBIENT_HERDR_SESSION="${HERDR_SESSION_NAME:-}"
if [ -n "$HERDR_SERVER_OPT" ]; then if [ -n "$HERDR_SERVER_OPT" ]; then
export HERDR_SESSION_NAME="$HERDR_SERVER_OPT" export HERDR_SESSION_NAME="$HERDR_SERVER_OPT"
else else
@@ -116,12 +117,17 @@ fi
# Issue #71: a session with no registry row (its create/resume died before # Issue #71: a session with no registry row (its create/resume died before
# registering it) is closed here - herdr only, the registry is left alone. It # registering it) is closed here - herdr only, the registry is left alone. It
# has no agent kind, so --agent is not needed. Only a session herdr runs # has no agent kind, so --agent is not needed. Only a session herdr runs
# inside this workspace is closed; anything else changes nothing. # inside this workspace is closed; anything else changes nothing. With no row
# the server is chosen as create_session.sh chose it: --herdr-session, else
# the environment's HERDR_SESSION_NAME, else the workspace's server.
stop_rowless() { stop_rowless() {
if [ "$PURGE" = "1" ]; then if [ "$PURGE" = "1" ]; then
echo "ERROR: session '$SESSION_NAME' not in $AGENT_SESSIONS_YAML; --purge-conversation needs its row. Nothing changed." >&2 echo "ERROR: session '$SESSION_NAME' not in $AGENT_SESSIONS_YAML; --purge-conversation needs its row. Nothing changed." >&2
exit 1 exit 1
fi fi
if [ -z "$HERDR_SERVER_OPT" ] && [ -n "$AMBIENT_HERDR_SESSION" ] && [ "$AMBIENT_HERDR_SESSION" != "default" ]; then
export HERDR_SESSION_NAME="$AMBIENT_HERDR_SESSION"
fi
local info cwd local info cwd
info=$(herdr agent get "$SESSION_NAME" 2>/dev/null) || info="" info=$(herdr agent get "$SESSION_NAME" 2>/dev/null) || info=""
if [ -z "$info" ]; then if [ -z "$info" ]; then
@@ -173,7 +179,13 @@ for s in d.get('herdr_sessions', []):
'delegate_job_logs_dir': cp.get('delegate_job_logs_dir', '') or ''})) 'delegate_job_logs_dir': cp.get('delegate_job_logs_dir', '') or ''}))
sys.exit(0) sys.exit(0)
sys.exit(7) sys.exit(7)
") || stop_rowless ") || MAPPED_RC=$?
# 7 = no row; any other failure (registry unreadable) stops as before.
[ "${MAPPED_RC:-0}" -ne 7 ] || stop_rowless
if [ "${MAPPED_RC:-0}" -ne 0 ]; then
echo "ERROR: cannot read the row of '$SESSION_NAME' from $AGENT_SESSIONS_YAML" >&2
exit 1
fi
# --agent 미지정 시 레지스트리 기록으로 해석 (B-21). # --agent 미지정 시 레지스트리 기록으로 해석 (B-21).
# ① row['agent'] → ② 세션명 접미사 → ③ pane.cmd 순. 셋 다 실패하면 # ① row['agent'] → ② 세션명 접미사 → ③ pane.cmd 순. 셋 다 실패하면
+4 -4
View File
@@ -433,7 +433,7 @@
"class": "c", "class": "c",
"kind": "diagram", "kind": "diagram",
"evidence": [ "evidence": [
"multi-agent-mux-stop/scripts/stop_session.sh:228-242" "multi-agent-mux-stop/scripts/stop_session.sh:240-254"
], ],
"mismatch": null, "mismatch": null,
"note": "state machine" "note": "state machine"
@@ -504,8 +504,8 @@
"class": "a", "class": "a",
"evidence": [ "evidence": [
"multi-agent-mux-stop/scripts/stop_session.sh:101", "multi-agent-mux-stop/scripts/stop_session.sh:101",
"multi-agent-mux-stop/scripts/stop_session.sh:120-176", "multi-agent-mux-stop/scripts/stop_session.sh:123-188",
"multi-agent-mux-stop/scripts/stop_session.sh:228-232" "multi-agent-mux-stop/scripts/stop_session.sh:240-244"
], ],
"mismatch": [ "mismatch": [
"T1: the doc offered --force-no-yaml, which no script accepts" "T1: the doc offered --force-no-yaml, which no script accepts"
@@ -601,7 +601,7 @@
"other" "other"
], ],
"passthrough": { "passthrough": {
"1": "multi-agent-mux-stop/scripts/stop_session.sh:367" "1": "multi-agent-mux-stop/scripts/stop_session.sh:379"
} }
}, },
"multi-agent-mux-create/scripts/create_session.sh": { "multi-agent-mux-create/scripts/create_session.sh": {