diff --git a/.agents/skills/multi-agent-mux-stop/SKILL.md b/.agents/skills/multi-agent-mux-stop/SKILL.md index 4de1301..6900b90 100644 --- a/.agents/skills/multi-agent-mux-stop/SKILL.md +++ b/.agents/skills/multi-agent-mux-stop/SKILL.md @@ -59,13 +59,13 @@ bash .agents/skills/multi-agent-mux-stop/scripts/stop_session.sh \ | Exit | Meaning | |---|---| | 0 | Stopped; or already `stopped` (no-op) | -| 1 | YAML not found, or the session is not registered | +| 1 | From the checks before the stop, nothing was changed: YAML not found, or the session is not registered. **The registry update after the stop also exits 1** (the row disappeared from the YAML during the run) | | 2 | Bad arguments (including the retired `--mode` / `--capture-id` / `--graceful`), or `--agent` omitted and not resolvable | | 3 | `--purge-conversation` without `--yes` | | 4 | Purge aborted: the herdr session survived the kill chain | | other | The registry update after the stop (YAML / DB write) failed and its code is passed through | -Exits 1, 2 and 3 come from checks before anything is stopped, so nothing was changed. On an `other` exit the session may already be down while its row still says `running`: check with `multi-agent-mux-status`, then run the stop again (it is idempotent). +Exits 2 and 3, and exit 1 from the pre-stop checks, come before anything is stopped, so nothing was changed. On exit 1 from the registry update, or an `other` exit, the session may already be down while its row still says `running`: check with `multi-agent-mux-status`, then run the stop again (it is idempotent). **Idempotency**: if the row is already `status: stopped`, the script prints `already stopped (...)` and exits 0 — re-running is a safe no-op. diff --git a/tests/data/skill_code_blocks.json b/tests/data/skill_code_blocks.json index cfd70c5..6b4c811 100644 --- a/tests/data/skill_code_blocks.json +++ b/tests/data/skill_code_blocks.json @@ -593,7 +593,9 @@ "4", "other" ], - "passthrough": {} + "passthrough": { + "1": "multi-agent-mux-stop/scripts/stop_session.sh:310" + } }, "multi-agent-mux-create/scripts/create_session.sh": { "skill": "multi-agent-mux-create", @@ -616,6 +618,7 @@ "C4: create named a nonexistent `agent-sessions-yaml-edit` script; removed (create_session.sh writes the row)", "C5: create's cmd_full table (claude = `claude`) disagreed with adapter spawn-spec; replaced by \"decided by spawn-spec\"", "C6: create_session.sh header lists exit 4 \"YAML append failure\"; there is no literal `exit 4`, but the YAML write raises SystemExit(4) for a duplicate running row (create_session.sh:515) and it passes through, so 4 IS a real exit code (the plan assumed it was not)", - "R6: resume's \"The script above re-passes them\" and \"as done in Workflow above\" pointed at the removed block; reworded (same for create's Verification note)" + "R6: resume's \"The script above re-passes them\" and \"as done in Workflow above\" pointed at the removed block; reworded (same for create's Verification note)", + "R7 (review 08e1f1b2): stop's table said exit 1 is always pre-stop; the registry update after the kill chain also raises SystemExit(1) (stop_session.sh:310) when the row disappeared" ] } \ No newline at end of file diff --git a/tests/test_issue42_skill_blocks.py b/tests/test_issue42_skill_blocks.py index 785087e..7989016 100644 --- a/tests/test_issue42_skill_blocks.py +++ b/tests/test_issue42_skill_blocks.py @@ -54,22 +54,34 @@ _HEREDOC = re.compile(r"(?