Skip to content

refactor(acp): move acp_adapter/ → hermes_agent/acp/#14606

Open
alt-glitch wants to merge 3 commits into
mainfrom
sid/restructure-pr1-acp
Open

refactor(acp): move acp_adapter/ → hermes_agent/acp/#14606
alt-glitch wants to merge 3 commits into
mainfrom
sid/restructure-pr1-acp

Conversation

@alt-glitch

Copy link
Copy Markdown
Collaborator

Summary

  • Move acp_adapter/ (9 files) into hermes_agent/acp/, creating the hermes_agent/ top-level package
  • Rewrite all imports, patch() targets, monkeypatch.setattr strings, and docstrings from acp_adapter.*hermes_agent.acp.*
  • Convert relative imports to absolute per manifest convention
  • Strip sys.path hack from entry.py (redundant with editable install)
  • Update pyproject.toml entry point and packages.find

This is the canary PR for the restructure (#14182) — smallest possible move (1 external prod caller) to prove the workflow.

Commit strategy: Commit 1 is a pure git mv (100% similarity for blame). Commit 2 is all import rewrites + infra.

Closes #14586

Test plan

  • rg "acp_adapter" --type py returns 0 results
  • rg "from \." hermes_agent/acp/ --type py returns 0 (no relative imports)
  • All 164 ACP tests pass (pytest tests/acp/ -v)
  • Full test suite: 14754 passed, 30 failed (all pre-existing), 41 skipped
  • from hermes_agent.acp.server import HermesACPAgent resolves
  • hermes-acp console script entry point resolves
  • Cross-package imports (hermes_constants, hermes_cli, agent, tools, run_agent) preserved untouched

Pure file moves, zero content changes. Creates the hermes_agent/
top-level package. Git sees 100% similarity on all moves.

Part of #14586, #14182
Rewrite all acp_adapter imports to hermes_agent.acp in source, tests,
and pyproject.toml. Convert relative imports to absolute per manifest
convention. Strip sys.path hack from entry.py (redundant with editable
install). Update pyproject.toml entry point and packages.find.

Part of #14586, #14182
@alt-glitch

Copy link
Copy Markdown
Collaborator Author

@BugBot review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 420c4d0. Configure here.

@alt-glitch alt-glitch added type/refactor Code restructuring, no behavior change P2 Medium — degraded but workaround exists comp/acp Agent Communication Protocol adapter comp/cli CLI entry point, hermes_cli/, setup wizard labels Apr 23, 2026
@kshitijk4poor

Copy link
Copy Markdown
Collaborator

PR #14606: refactor(acp): move acp_adapter/ → hermes_agent/acp/

What this PR does: First "canary" PR in the restructure plan (#14182) to create a proper hermes_agent top-level Python package. Moves the 9-file acp_adapter/ directory into hermes_agent/acp/, rewrites all imports, converts relative imports to absolute, strips the sys.path hack from entry.py, and updates pyproject.toml entry points and package discovery.


✅ What's done correctly

Import rewrite completeness (Python) — All 7 import sites correctly updated:

  • server.py: 4 absolute from acp_adapter.*from hermes_agent.acp.*
  • events.py: 1 relative from .tools → absolute
  • entry.py: 1 relative from .server → absolute
  • __main__.py: 1 relative from .entry → absolute (new file)

External consumer updates — Both references updated:

  • cli.py:8457: Comment reference
  • hermes_cli/main.py:8519: Import path

Test patch targets — All 21 patch("acp_adapter.…") / monkeypatch.setattr("acp_adapter.…") targets across 8 test files correctly rewritten ✓

pyproject.toml — Entry point (hermes-acp) and packages.find ("hermes_agent", "hermes_agent.*") both correct ✓

sys.path hack removal — Removes the Path(__file__).resolve().parent.parent insertion + unused from pathlib import Path, keeps import sys (still needed for sys.stderr/sys.exit) ✓

Commit strategy — Clean two-commit: commit 1 is pure git mv (preserves blame), commit 2 is import/infra rewrites ✓

CI — All 14 test failures are pre-existing on main (verified against main run 24837618899). No regressions ✓


⚠️ Missing: Documentation updates (21 stale references)

All Python files and tests are covered, but 21 acp_adapter references across 5 markdown files are not updated:

File Count Nature
AGENTS.md 1 Directory listing ├── acp_adapter/
website/docs/developer-guide/acp-internals.md 15 File paths, import paths, module references
website/docs/developer-guide/architecture.md 2 Architecture diagram + directory listing
website/docs/reference/cli-commands.md 1 python -m acp_adapter usage
website/docs/user-guide/features/acp.md 2 python -m acp_adapter references

Non-blocking (no runtime impact), but docs will be stale. Could be addressed in this PR or as an immediate follow-up.


Verdict

Clean, well-structured refactor. Code changes are mechanically correct — no bugs, no orphaned references, no backward compat issues. Cross-package imports (hermes_cli, tools, agent) correctly untouched. Safe to merge pending the docs update decision.

@alt-glitch

Copy link
Copy Markdown
Collaborator Author

@kshitijk4poor updated docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/acp Agent Communication Protocol adapter comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

restructure PR 1: move acp_adapter/ → hermes_agent/acp/ (canary)

2 participants