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:
2026-07-20 07:42:05 +09:00
parent cccc30a8ac
commit 6df4b03661
13 changed files with 312 additions and 115 deletions
+18 -8
View File
@@ -81,7 +81,7 @@ export HERDR_SERVER_NAME="$(resolve_herdr_server "$SESSION_NAME")"
# 2. If herdr is alive, attach. Done.
if herdr has-session -t "$SESSION_NAME" 2>/dev/null; then
echo "herdr '$SESSION_NAME' already running. Attaching..."
exec herdr attach -t "$SESSION_NAME"
exec herdr agent attach "$SESSION_NAME"
fi
# 3. Resolve isolation settings for this session (T4/T5 re-apply)
@@ -160,8 +160,9 @@ esac
bash .agents/skills/multi-agent-mux-resume/scripts/update_yaml_resumed.sh \
--session "$SESSION_NAME" --uuid "$UUID"
# 5. Attach
herdr attach -t "$SESSION_NAME"
# 5. Attach (real native command — "attach" isn't in the lib.sh tmux-compat shim,
# and real herdr has no `-t` flag here, only a positional target)
herdr agent attach "$SESSION_NAME"
```
## Pitfalls
@@ -175,8 +176,12 @@ herdr attach -t "$SESSION_NAME"
## Verification
```bash
# 1. herdr alive with the right cmd
herdr list-panes -t "$SESSION_NAME" -F 'cmd=#{pane_current_command} cwd=#{pane_current_path}'
# 1. herdr alive with the right cmd (real native command, no lib.sh needed)
herdr agent get "$SESSION_NAME" | python3 -c "
import sys, json
a = json.load(sys.stdin)['result']['agent']
print(f\"cmd={a['agent']} cwd={a['cwd']}\")
"
# 2. agent-sessions.yaml updated
python3 -c "
@@ -187,14 +192,19 @@ print(f' status: {s[\"status\"]}')
print(f' pane.cmd_full: {s[\"pane\"][\"cmd_full\"]}')
"
# 3. TUI shows resumed conversation (capture-pane to verify)
# 3. TUI shows resumed conversation (real native command, no lib.sh needed)
sleep 5
herdr capture-pane -t "$SESSION_NAME" -p -S -30
herdr agent read "$SESSION_NAME" --source visible --lines 30
# look for the previous message at top of the buffer (claude) or last_visible_status set (agy)
```
> `herdr list-panes` / `herdr capture-pane` here are tmux-compat pseudo-commands that only
> work after `source .agents/skills/lib.sh` (as done in `Workflow` above) — the real `herdr`
> binary doesn't have those subcommands. This block uses the real `herdr agent get`/`herdr agent read`
> equivalents instead so it also works standalone.
## When NOT to use this skill
- **No saved session yet** → `multi-agent-mux-create`
- **Killing an existing session** → `multi-agent-mux-stop`
- **Just attaching** → `herdr attach -t <name>` (no skill needed)
- **Just attaching** → `herdr agent attach <name>` (no skill needed)