Skip to content

feat: add ACP agent server with CLI, tool bridge, and registry manifest#669

Closed
pabl-o-ce wants to merge 6 commits intoNousResearch:mainfrom
pabl-o-ce:main
Closed

feat: add ACP agent server with CLI, tool bridge, and registry manifest#669
pabl-o-ce wants to merge 6 commits intoNousResearch:mainfrom
pabl-o-ce:main

Conversation

@pabl-o-ce
Copy link

@pabl-o-ce pabl-o-ce commented Mar 8, 2026

Summary

  • Add hermes acp subcommand and hermes-acp entry point to launch an ACP JSON-RPC stdio server
  • Implement HermesACPAgent with full ACP lifecycle: initialize, authenticate, session management (new/load/list/fork/resume),
    prompt execution, and cancellation
  • Wire acp dependency and [acp] extra in pyproject.toml
  • Add ToolBridge to delegate editor tool calls (file edits, terminal, etc.) back through the ACP client connection
  • Stream tool progress and agent responses to the editor via session_update notifications
  • Add acp_registry/ with agent.json manifest and SVG icon for ACP Registry submission
  • Add shutdown lifecycle with proper cleanup of sessions and ThreadPoolExecutor

Test plan

  • pip install -e ".[acp]" installs without errors and acp extra pulls in the acp dependency
  • hermes acp starts the ACP JSON-RPC stdio server without crashing
  • hermes-acp entry point also launches the server
  • python -c "from acp_adapter.server import HermesACPAgent" imports cleanly
  • Initialize handshake returns correct protocol_version, agent_info, and session_capabilities (list, fork, resume)
  • new_session creates a session and returns a valid session_id
  • list_sessions returns previously created sessions
  • load_session / resume_session re-attach to an existing session
  • prompt with a text block runs the agent and streams the response text back via session_update
  • Tool calls during prompt emit start_tool_call session updates with tool name and status
  • step_cb(api_call_count: int, prev_tools: list) matches AIAgent call signature and executes without error
  • Response text is read from result["final_response"] (not "response")
  • cancel sets the cancel event, calls agent.interrupt(), and prompt returns stop_reason="cancelled"
  • ToolBridge delegates editor tool calls back to the ACP client via run_coroutine_threadsafe
  • ToolBridge._run() raises a descriptive RuntimeError on 120s timeout instead of raw TimeoutError
  • Shutdown cleans up all sessions and stops the ThreadPoolExecutor
  • acp_registry/agent.json is valid against the ACP registry schema
  • acp_registry/icon.svg exists and is a valid SVG

Remove unused run_agent import, make mcp_servers Optional in
new_session/load_session, fix set_config_option value type to str,
and correct ext_method/ext_notification param and return types.

Author: Pablo Carrera <pabloce@poscye.com>
- Add `hermes acp` subcommand and `hermes-acp` entry point
- Wire acp_adapter and acp dependency in pyproject.toml
- Add ACP tool bridge delegation in AIAgent for editor tool routing
- Add acp_registry/ with agent.json manifest and icon

Author: Pablo Carrera <pabloce@poscye.com>
Add list_sessions, fork_session, resume_session stubs; enable unstable
protocol so set_session_model and new session methods are routable;
fix load_session param order, return types, ext_* signatures, and
set_config_option value default; add repository/license to agent.json
and improve auth error messaging.

Author: Pablo Carrera <pabloce@poscye.com>
The step_cb was defined with (step_info: dict) but called with
(api_call_count: int, prev_tools: list), causing a silent TypeError
every iteration. The response text was read from result["response"]
but run_conversation returns it as result["final_response"], so
responses never reached the editor.

Also adds shutdown/cleanup lifecycle, session capability declarations,
and tool bridge timeout handling.

Author: Pablo Carrera <pabloce@poscye.com>
@pabl-o-ce pabl-o-ce changed the title fix: ACP cancel flow bugs and adapter hardening feat: add ACP agent server with CLI, tool bridge, and registry manifest Mar 8, 2026
Rewrite agent.json for registry validation (name field, remove extras/auth,
fix schema URL), add hermes-agent acp CLI routing, fix resume_session to
reject unknown sessions, update cwd on session reload, and pass cwd on
prompt auto-create.

Author: Pablo Carrera <pabloce@poscye.com>
@teknium1
Copy link
Contributor

Thanks for the contribution! We've since implemented a more complete ACP integration in PR #837, which includes modular architecture (server, session, events, tools, permissions, auth modules), full test coverage (41 tests), tool kind mapping, permission bridging to editor dialogs, reasoning/thinking streaming, and more.

Closing in favor of #837. Appreciate you pushing for ACP support — it helped validate the direction!

@teknium1 teknium1 closed this Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants