fix(reset,stop): warn before a reset purges, skip and prune stale registries, refuse a guessed purge
reset.sh without --yes says the conversations are deleted for good before it asks; without a terminal the refusal says so too. A registry that cannot be created is skipped, since nothing can be registered there, and the directories the fence created are removed on exit when still empty. stop --purge-conversation refuses a conversation the row does not record instead of deleting the folder's newest one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VCgu9Fa9iT7TbJUSzdq4Ff
This commit is contained in:
1 parent
12e140322d
commit
022c656052
9 files changed
+201
-28
No files matched your search
@@ -58,7 +58,7 @@ bash .agents/skills/multi-agent-mux-stop/scripts/stop_session.sh \
|
||||
| Exit | Meaning |
|
||||
|---|---|
|
||||
| 0 | Stopped; or already `stopped` (no-op, except with `--purge-conversation`, which still purges) |
|
||||
| 1 | From the checks before the stop, nothing was changed: YAML not found, its row could not be read, the session is neither registered nor on the herdr server, or an update of the workspace is in progress (`multi-agent-mux-update`). **The registry update after the stop also exits 1** (the row disappeared from the YAML during the run) |
|
||||
| 1 | From the checks before the stop, nothing was changed: YAML not found, its row could not be read, the session is neither registered nor on the herdr server, an update of the workspace is in progress (`multi-agent-mux-update`), or `--purge-conversation` found only a conversation the row does not record (a claude/grok row with no usable id; a plain stop records it, so it can be checked and then purged). **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, or an agent process still holding the conversation, survived the kill chain. Records preserved: the registry row and the conversation files are untouched, though the session itself may already be down |
|
||||
|
||||
@@ -286,6 +286,11 @@ if [ -n "$TARGET_CWD" ]; then
|
||||
[ "$HERDR_ALIVE" = "1" ] && PANE_PID_NOW=$(herdr list-panes -t "$SESSION_NAME" -F '#{pane_pid}' 2>/dev/null | head -1 || true)
|
||||
eval "$(mam_session_ids stop --session "$SESSION_NAME" --agent "$AGENT" --cwd "$TARGET_CWD" \
|
||||
--herdr-alive "$HERDR_ALIVE" --pane-pid "$PANE_PID_NOW" --purge "$PURGE")" || true
|
||||
if [ "$CAPTURE_STATUS" = "purge-unrecorded" ]; then
|
||||
echo "ERROR: refusing to purge $SESSION_NAME; nothing was changed: $STOP_ID_NOTE." >&2
|
||||
echo " A stop without --purge-conversation records that id; check it is this agent's conversation, then purge." >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ -n "$CAPTURED_UUID" ]; then echo "captured conversation id: $CAPTURED_UUID"
|
||||
else echo "WARN: no conversation id recorded before stop${STOP_ID_NOTE:+ - $STOP_ID_NOTE}"; fi
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user