feat(reset): multi-agent-mux-reset skill - reset.sh, SKILL.md, packaging (#78)

This commit is contained in:
Godopu committed 2026-10-29 12:52:17 +00:00
1 parent ca2532307f
commit fb1895030f
12 files changed
+1248 -58

No files matched your search

+23 -8
View File
@@ -18,7 +18,7 @@ SKILLS = REPO_ROOT / ".agents" / "skills"
if str(SKILLS) not in sys.path:
sys.path.insert(0, str(SKILLS))
from lib_py.agents.base import DiscoveryContext, file_holders # noqa: E402
from lib_py.agents.base import DiscoveryContext # noqa: E402
from lib_py.agents.registry import get_adapter # noqa: E402
pytestmark = pytest.mark.usefixtures("own_workspace_root")
@@ -142,18 +142,33 @@ def test_in_use_hints_list_lsof_holders(tmp_path, monkeypatch, agent):
assert f"ps -axww | grep {conv}" in hints[0]
assert any(f"held open by pid {holder.pid}:" in h and "sleep 300" in h for h in hints)
assert target in adapter.in_use_paths(conv, ctx)
# Control: without lsof on PATH, file_holders returns [] and hints match the pre-#78 lines.
monkeypatch.setenv("PATH", str(no_lsof_bin))
assert file_holders([target]) == []
hints_no_lsof = adapter.in_use_hints(conv, ctx)
assert not any("held open by pid" in h for h in hints_no_lsof)
assert any(f"ps -axww | grep {conv}" in h for h in hints_no_lsof)
finally:
holder.kill()
holder.wait()
def test_in_use_hints_no_lsof_unchanged(tmp_path, monkeypatch):
"""§5.1 regression control: without lsof on PATH, hints match pre-#78 lines."""
home = tmp_path / "home"
ws = tmp_path / "ws"
no_lsof_bin = tmp_path / "no-lsof-bin"
for d in (home, ws, no_lsof_bin):
d.mkdir(parents=True, exist_ok=True)
monkeypatch.setenv("HOME", str(home))
monkeypatch.setenv("HOME_DIR", str(home))
monkeypatch.setenv("CODEX_HOME", str(home / ".codex"))
monkeypatch.setenv("PATH", str(no_lsof_bin))
for agent in ("claude", "agy", "codex", "grok", "hermes"):
conv = str(uuidlib.uuid4())
ctx = DiscoveryContext(workspace=str(ws), agent_name=agent, home_dir=str(home))
_materialize_artifact(agent, conv, ctx)
adapter = get_adapter(agent)
hints = adapter.in_use_hints(conv, ctx)
assert not any("held open by pid" in h for h in hints)
assert any(f"ps -axww | grep {conv}" in h for h in hints)
def test_in_use_hints_opencode_skip_service(tmp_path, monkeypatch):
home = tmp_path / "home"
ws = tmp_path / "ws"