diff --git a/.dev/refactor/roadmap.md b/.dev/refactor/roadmap.md index 105d131..a8061c7 100644 --- a/.dev/refactor/roadmap.md +++ b/.dev/refactor/roadmap.md @@ -119,6 +119,7 @@ Status: - Hermes-facing install surfaces exist in three explicit modes: `hermit install --print-hermes-mcp-config`, `hermit install --fix-hermes-mcp`, and `hermit install --test-hermes-mcp`. - The Hermes-facing fix/test surfaces now also accept `--hermes-home` so registration and smoke can be exercised against an isolated Hermes config directory. - `hermit doctor` now also accepts `--hermes-home` so the Hermes MCP diagnostic can inspect the same isolated config target before or after repair. +- `hermit doctor --fix --hermes-home ...` now reports the targeted Hermes config directory back in the repair summary so isolated repair runs are easier to verify in logs. - Live runtime delivery remains the existing Hermit MCP server path; the Hermes wrapper is a setup/health adapter, not a second runtime. - Release smoke has already verified npm and PyPI packages can print, register, and test the Hermes-facing MCP configuration without requiring OpenAI API-key onboarding. diff --git a/CHANGELOG.md b/CHANGELOG.md index 14c4f3b..b550b22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ - Added `hermit install --fix-hermes-mcp` as an explicit Hermes Agent MCP registration path that calls `hermes mcp add hermit-channel --command hermit --args mcp-server` only when requested. - Added `hermit install --test-hermes-mcp` as an explicit live MCP wiring smoke that runs `hermes mcp test hermit-channel` without mutating Hermes config. - Added optional `--hermes-home` targeting for `hermit doctor`, `hermit install --fix-hermes-mcp`, and `hermit install --test-hermes-mcp` so isolated Hermes config directories can be diagnosed, repaired, and smoke-tested without touching the operator's default `~/.hermes`. +- `hermit doctor --fix --hermes-home ...` now echoes the targeted Hermes config directory in its repair summary so operators can verify which isolated config was just modified. - Tightened the Hermes MCP smoke so it treats `hermes mcp test hermit-channel` output such as `Server 'hermit-channel' not found in config` as a failure even when the Hermes CLI exits with status 0. - Tightened `hermit install --fix-hermes-mcp` so it answers Hermes Agent's tool-enable prompt, rejects `Cancelled` output even with exit code 0, and verifies the registration is visible in `hermes mcp list` before reporting success. - Added an optional `Hermes MCP` doctor diagnostic that checks for `hermit-channel -> hermit mcp-server` registration and tolerates current `hermes mcp list` text-only output. diff --git a/docs/hermes-setup.md b/docs/hermes-setup.md index acc38ee..e129100 100644 --- a/docs/hermes-setup.md +++ b/docs/hermes-setup.md @@ -69,10 +69,13 @@ If you want an isolated Hermes config during registration, smoke, or doctor chec ```bash hermit install --fix-hermes-mcp --hermes-home /tmp/hermes-home -hermit install --test-hermes-mcp --hermes-home /tmp/hermes-home +hermit doctor --fix --hermes-home /tmp/hermes-home hermit doctor --hermes-home /tmp/hermes-home +hermit install --test-hermes-mcp --hermes-home /tmp/hermes-home ``` +When you use `doctor --fix --hermes-home`, the repair summary now echoes `Hermes target: ...` so logs make the isolated target explicit. + Under the hood this executes Hermes Agent's live MCP check for `hermit-channel` without mutating config beyond the explicit `--fix-hermes-mcp` path. You can also inspect Hermes directly: diff --git a/hermit_agent/doctor.py b/hermit_agent/doctor.py index 4cbbf90..07f75d2 100644 --- a/hermit_agent/doctor.py +++ b/hermit_agent/doctor.py @@ -367,7 +367,10 @@ def format_doctor_fix_summary(*, cwd: str, hermes_home: str | None = None) -> st hermes_home=hermes_home, ) - lines = ["Hermit doctor --fix complete.", "", "Repairs:"] + lines = ["Hermit doctor --fix complete."] + if hermes_home: + lines.extend(["", f"Hermes target: {hermes_home}"]) + lines.extend(["", "Repairs:"]) lines.append(f"- startup heal: gateway={startup.gateway_status}, mcp={startup.mcp_registration_status}, codex={startup.codex_runtime_status}") lines.append(f"- install flow: gateway={install.gateway_status}, mcp={install.mcp_registration_status}, codex={install.codex_install_status}, agent-learner={install.agent_learner_status}") lines.append("- codex-facing surface remains: hermit-channel MCP") diff --git a/tests/test_cli_defaults.py b/tests/test_cli_defaults.py index 2aba7ed..5fad0c1 100644 --- a/tests/test_cli_defaults.py +++ b/tests/test_cli_defaults.py @@ -282,11 +282,16 @@ def test_main_dispatches_doctor_fix(monkeypatch, capsys): monkeypatch.setattr(main_mod.sys, "argv", ["hermit-agent", "doctor", "--cwd", "/tmp/demo", "--fix", "--hermes-home", "/tmp/hermes-home"]) seen = [] - monkeypatch.setattr("hermit_agent.doctor.format_doctor_fix_summary", lambda **kwargs: seen.append(kwargs) or "Hermit doctor --fix complete.") + monkeypatch.setattr( + "hermit_agent.doctor.format_doctor_fix_summary", + lambda **kwargs: seen.append(kwargs) or "Hermit doctor --fix complete.\nHermes target: /tmp/hermes-home", + ) main_mod.main() - assert "Hermit doctor --fix complete." in capsys.readouterr().out + out = capsys.readouterr().out + assert "Hermit doctor --fix complete." in out + assert "Hermes target: /tmp/hermes-home" in out assert seen == [{"cwd": "/tmp/demo", "hermes_home": "/tmp/hermes-home"}] diff --git a/tests/test_doctor_cli.py b/tests/test_doctor_cli.py index 1661680..4315dad 100644 --- a/tests/test_doctor_cli.py +++ b/tests/test_doctor_cli.py @@ -34,6 +34,7 @@ def fake_run_install(**kwargs): text = format_doctor_fix_summary(cwd="/tmp/demo", hermes_home="/tmp/hermes-home") assert "Hermit doctor --fix complete." in text + assert "Hermes target: /tmp/hermes-home" in text assert "gateway=started" in text assert "mcp=registered" in text assert "codex=installed" in text