Align conftest mock herdr and unit test assertions with Claude's simplified session-based isolation and native herdr command updates
This commit is contained in:
@@ -111,8 +111,9 @@ The script:
|
||||
## Verification
|
||||
|
||||
```bash
|
||||
# 1. herdr gone
|
||||
herdr has-session -t "$SESSION_NAME" 2>/dev/null && echo "STILL ALIVE" || echo "OK: herdr gone"
|
||||
# 1. herdr gone (real native command — `herdr has-session` is a lib.sh
|
||||
# tmux-compat pseudo-command and needs `source .agents/skills/lib.sh` first)
|
||||
herdr agent get "$SESSION_NAME" >/dev/null 2>&1 && echo "STILL ALIVE" || echo "OK: herdr gone"
|
||||
|
||||
# 2. YAML has stopped entry
|
||||
python3 -c "
|
||||
@@ -131,6 +132,6 @@ print(f' preserved: pane.pid={s[\"pane\"][\"pid\"]}, cmd={s[\"pane\"][\"cmd\"]}
|
||||
|
||||
## When NOT to use this skill
|
||||
|
||||
- **Just detaching** → `herdr detach` (Ctrl-B d) or just close the terminal. The herdr session keeps running.
|
||||
- **Stopping the agent inside but keeping herdr** → send `Ctrl-C` or `/exit` (claude) / `Ctrl-D` (agy) via `herdr send-keys`. The herdr session stays but the agent process is gone.
|
||||
- **Just detaching** → there's no `herdr detach` CLI command; press the herdr detach keybinding inside the pane, or just close the terminal. The herdr session keeps running.
|
||||
- **Stopping the agent inside but keeping herdr** → send `Ctrl-C` or `/exit` (claude) / `Ctrl-D` (agy) via `herdr agent send <target> <text>` (real native command; `herdr send-keys` is a lib.sh tmux-compat pseudo-command that needs `source .agents/skills/lib.sh` first). The herdr session stays but the agent process is gone.
|
||||
- **Replacing an existing session with a new one** → `multi-agent-mux-stop` first, then `multi-agent-mux-create`.
|
||||
|
||||
@@ -67,9 +67,21 @@ while [ $# -gt 0 ]; do
|
||||
*) echo "ERROR: unknown arg: $1" >&2; usage; exit 2 ;;
|
||||
esac
|
||||
done
|
||||
if [ -n "$AGENT" ]; then
|
||||
case "$AGENT" in
|
||||
claude|agy|hermes|cline) ;;
|
||||
*) echo "ERROR: invalid agent type '$AGENT'. Allowed types are: claude, agy, hermes, cline." >&2; exit 2 ;;
|
||||
esac
|
||||
fi
|
||||
[ -n "$SESSION_NAME" ] || { echo "ERROR: --session required" >&2; usage; exit 2; }
|
||||
[ -f "$AGENT_SESSIONS_YAML" ] || { echo "ERROR: $AGENT_SESSIONS_YAML not found" >&2; exit 1; }
|
||||
|
||||
# Implement the purging-<session> file lock mechanism
|
||||
if [ "$PURGE" = "1" ]; then
|
||||
touch "$WORKSPACE_ROOT/.mam/purging-$SESSION_NAME"
|
||||
trap 'rm -f "$WORKSPACE_ROOT/.mam/purging-$SESSION_NAME"' EXIT
|
||||
fi
|
||||
|
||||
HERDR_SERVER_NAME="$(resolve_herdr_workspace "$SESSION_NAME")"
|
||||
export HERDR_SERVER_NAME
|
||||
|
||||
|
||||
Reference in New Issue
Block a user