fix: attach_command from one builder; no kill/start_command; stop closes a row-less session (Issue #71)

- attach_command is `herdr --session <server> agent attach <herdr name>`
  (`default` written too), built by lib_py.agents.sanitize.attach_command;
  create, resume and reconcile all use it. kill_command and start_command
  are no longer written, and status --json drops start_command.
- The two raw kill-session hints (create exit 43, id_order's orphan) print a
  stop-skill command with --herdr-session instead.
- stop_session.sh closes a session that has no registry row, herdr only and
  without --agent, when herdr runs it inside this workspace; another
  workspace's session is refused (exit 5), a missing one is exit 1, one that
  survives kill-session is exit 6. The registry is not changed.
- Docs: only the SKILL.md lines these changes made wrong; the skill block
  pins follow. Tests that asserted the removed fields keep their intent
  (issue50: create's own row; issue21: no control-root path in
  attach_command; tier2: the new form and the absent fields). S11 pins the
  shim to 4243da5, which changed it on purpose.

Refs #71

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
GodopuandClaude Opus 5.5 committed 2026-10-25 15:16:53 +00:00
1 parent 9c21fa4e4f
commit e4c7c8fe9b
19 files changed
+605 -109

No files matched your search

+10 -11
View File
@@ -214,13 +214,13 @@ def test_comp_create_herdr_session_default_preserved(mam_sandbox, mock_herdr, mo
assert s["name"] == "custom-proj-default-claude"
assert s["herdr_session"] == "default"
assert s["herdr_server"] == "default"
assert "HERDR_SESSION_NAME=default" in s["start_command"]
assert "HERDR_SESSION_NAME=default" in s["attach_command"]
assert "HERDR_SESSION_NAME=default" in s["kill_command"]
# Issue #71: the native form, `default` named too; no start/kill_command
assert s["attach_command"] == "herdr --session default agent attach custom-proj-default-claude"
assert "start_command" not in s and "kill_command" not in s
def test_comp_create_herdr_session_yaml_propagation(mam_sandbox, mock_herdr, mock_agents):
"""Verify HERDR_SESSION_NAME propagation into start_command / herdr_session YAML field."""
"""Verify HERDR_SESSION_NAME propagation into attach_command / herdr_session YAML field."""
script = mam_sandbox / ".agents" / "skills" / "multi-agent-mux-create" / "scripts" / "create_session.sh"
res = subprocess.run([
"bash", str(script),
@@ -242,9 +242,8 @@ def test_comp_create_herdr_session_yaml_propagation(mam_sandbox, mock_herdr, moc
assert s["name"] == "custom-proj-creator-claude"
assert s["herdr_session"] == "isolated-suite-01"
assert s["herdr_server"] == "isolated-suite-01"
assert "HERDR_SESSION_NAME=isolated-suite-01" in s["start_command"]
assert "HERDR_SESSION_NAME=isolated-suite-01" in s["attach_command"]
assert "HERDR_SESSION_NAME=isolated-suite-01" in s["kill_command"]
assert s["attach_command"] == "herdr --session isolated-suite-01 agent attach custom-proj-creator-claude"
assert "start_command" not in s and "kill_command" not in s
def test_comp_create_herdr_workspace_parsing_and_env_fallback(mam_sandbox, mock_herdr, mock_agents):
@@ -332,9 +331,9 @@ def test_comp_create_herdr_workspace_yaml_propagation(mam_sandbox, mock_herdr, m
assert s["herdr_session"] == "isolated-sock-01"
assert s["herdr_server"] == "isolated-sock-01"
assert s["herdr_workspace"] == "distinct-ws-label"
assert "distinct-ws-label" not in s["start_command"]
assert "distinct-ws-label" not in s["attach_command"]
assert "distinct-ws-label" not in s["kill_command"]
assert s["attach_command"] == "herdr --session isolated-sock-01 agent attach custom-ws-creator-claude"
assert "start_command" not in s and "kill_command" not in s
def test_create_does_not_inherit_a_stale_workspace_label(mam_sandbox, mock_herdr, mock_agents):
@@ -573,8 +572,8 @@ d['herdr_sessions'] = [{{
assert s["status"] == "running"
assert s["herdr_session"] == "NEW-HERDR-SESSION"
assert s["herdr_server"] == "NEW-HERDR-SESSION"
assert "HERDR_SESSION_NAME=NEW-HERDR-SESSION" in s["attach_command"]
assert "HERDR_SESSION_NAME=NEW-HERDR-SESSION" in s["kill_command"]
assert s["attach_command"] == "herdr --session NEW-HERDR-SESSION agent attach test-proj-creator-claude"
assert "start_command" not in s and "kill_command" not in s
def test_comp_resume_herdr_workspace_propagation(mam_sandbox, mock_herdr, mock_agents):