Merge review on macOS (--review-only loops, --all-reviewer): round 1 at320aa9f4/4 NOT PASS, round 2 codex F1 (a claimed dry-run job holds its session), round 3 4/4 PASS (discarded: the worktree changed mid-review), round 4 at21f0c12claude/agy/grok PASS with codex interrupted by a stream disconnect, round 5 codex PASS. Full suite at21f0c12on macOS / Python 3.9 / bash 3.2 / herdr 0.9.3: 1860 passed / 0 failed / 38 skipped; no new entries in ~/.claude/projects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VCgu9Fa9iT7TbJUSzdq4Ff
6.1 KiB
Code Review Report (4th Round Re-Review): PR #56 (fix/issue-50-55)
- Job ID:
05f28276 - Reviewer:
agy(Session:herdr:reviewer-agy-01, Role:Reviewer) - Date: 2026-10-12
- Target Pull Request: PR #56 (
fix/issue-50-55, Closes #50, #55) - Base Commit:
efd27def47a4d67684694ccf43a6ebeede01620f(3rd round review head) - Head Commit:
21f0c12b9e2195cba8e196d6ccc2469173302e8a(Fix commit) - Verification Path:
/var/folders/q_/68sxgw3j073dgjg8wl9s08vw0000gn/T/mam-review/loop-20261012T013821Z-656dfe/1 - Verification Environment: macOS (Darwin 24.3.0, arm64), Python 3.9.6, bash 3.2.57(1)-release,
herdr0.9.3
1. Executive Summary
This 4th-round re-review evaluated commit 21f0c12b9e2195cba8e196d6ccc2469173302e8a, which addresses the regression discovered on macOS during full-suite testing where tests/test_tier4_e2e.py::test_e2e_scenario4_parallel_flock_locking (6 concurrent creates into the same folder) failed with exit code 4 (already running in agent-sessions.yaml).
Root Cause
During parallel create_session.sh invocations, create_session.sh runs reconcile.sh --once under ambient HERDR_SESSION_NAME=<slug>.
- In
reconcile.sh,unique_serversalways includes'default'. - The scan for
'default'executesherdr lswithout-L. - The
.mam/shim/herdrwrapper inspectsHERDR_SESSION_NAME; because it is set to<slug>,_real_herdrdelegates to"$HERDR_BIN" --session "$session" "$@". - Thus, the pane list returned by the
'default'scan actually reflects the panes on server<slug>. - Previously,
reconcile.shdrift B labeled these newly discovered panes withherdr_server: default. - When concurrent
create_session.shprocesses attempted to adopt the auto-registered pane via_adopted_own, they required(s.get('herdr_server') or ...) == server_name(whereserver_namewas<slug>). Because the monitor row recorded'default', the comparison failed andcreate_session.shaborted with exit code 4.
The Fix
In multi-agent-mux-monitor/scripts/reconcile.sh:659-661:
_ambient = os.environ.get('HERDR_SESSION_NAME', '')
if srv == 'default' and _ambient and _ambient != 'default':
srv = _ambient
server_opt = f"-L {srv} " if srv != 'default' else ""
If the sweep is querying 'default' but HERDR_SESSION_NAME is set to an explicit server in the environment, reconcile.sh recognizes that the shim returned panes from that server, and records herdr_session: _ambient, herdr_server: _ambient, and -L _ambient in the entry.
Additionally, tests/data/skill_code_blocks.json was updated to line 550 for SystemExit(4) in create_session.sh.
Verdict: PASS.
2. Detailed Technical Verification
2.1 Correctness of the Ambient Server Attribution
- In
.agents/skills/lib.sh:271-280:Calls to_real_herdr() { local session="${HERDR_SESSION_NAME:-}" if [ "$session" = "default" ]; then session=""; fi if [ -n "$session" ]; then if [ "${1:-}" = "--session" ] || [ "${1:-}" = "-s" ]; then "$HERDR_BIN" "$@"; else "$HERDR_BIN" --session "$session" "$@"; fi else "$HERDR_BIN" "$@" fi }herdrwithout-Lor--sessionare answered byherdr --session "$session". Thus, attributing panes found in a'default'scan toHERDR_SESSION_NAMEis strictly faithful to the actual server queried by_real_herdr.
2.2 Side-Effect Analysis
- Drift A (Termination Detection):
- When a row is registered with
herdr_server: <slug>, subsequent sweeps populateunique_serversfromd.get('herdr_sessions'), adding<slug>. reconcile.shexplicitly scans-L <slug>and places(name, '<slug>')intoalive_set.- In drift A,
(s.get('name'), s.get('herdr_server'))matchesalive_set. The row is not falsely terminated.
- When a row is registered with
- Daemon Mode (No Ambient Server):
- In persistent monitor daemon runs (
reconcile.sh --subscribe),HERDR_SESSION_NAMEis empty or'default'. _ambient and _ambient != 'default'evaluates toFalse, preserving exact default behavior.
- In persistent monitor daemon runs (
- Duplicate Registration Prevention:
- In drift B,
yaml_session_names.add(name)is updated immediately when a pane is registered. - If the same pane is enumerated in both the
'default'scan and an explicit-L <slug>scan within the same sweep, line 611 skips the duplicate (if (name, srv) in yaml_session_names or any(_sanitize(y) == name for y in yaml_session_names): continue). No duplicate entries are created.
- In drift B,
2.3 Verification of Fixed Tests
test_e2e_scenario4_parallel_flock_locking:- Executed
tests/test_tier4_e2e.py: all 5 scenarios passed in 364.51s, with scenario 4 completing in 42.28s without exit code 4.
- Executed
tests/test_issue50_pane_lock.py:- Executed full test suite: 11 / 11 passed in 53.20s.
tests/test_issue42_skill_blocks.py:- Executed: 37 passed, 1 skipped. Line 550 in
tests/data/skill_code_blocks.jsonmatchescreate_session.shexactly.
- Executed: 37 passed, 1 skipped. Line 550 in
3. Test Execution Summary
| Test Target | Result | Duration |
|---|---|---|
tests/test_tier4_e2e.py::test_e2e_scenario4_parallel_flock_locking |
1 Passed | 42.28s |
tests/test_tier4_e2e.py (Full Suite, 5 Scenarios) |
5 Passed | 364.51s |
tests/test_issue50_pane_lock.py (Full Suite) |
11 Passed | 53.20s |
tests/test_issue42_skill_blocks.py |
37 Passed, 1 Skipped | 0.17s |
[VERDICT: PASS]