Skip to content

Implement a special ACPAgent which is a Agent-Client Protocol Client? #590

Closed

Description

@xingyaoww

Context/Motivation

What if we change CLI and GUI as ACP clients to interact with all these agents based on the Agent-Client Protocol (https://agentclientprotocol.com/protocol/overview)?

In that case, we can possibly re-use Claude-Code (https://github.com/zed-industries/claude-code-acp), the Gemini CLI ACP that Zed already implemented, and launch these different agents inside our sandbox and treat them as an agent there 🤔

This should allow us to leverage the ACP ecosystem and position OpenHands as a model-agnostic agent platform (e.g., you can even use your Claude-code subscription / Codex / Gemini CLI subscription with OpenHands via ACP) — and all these agents are using OpenHands as a unified interface.

This will actually allow us to directly integrate Claude-code/Gemini CLI into OpenHands & allowing users to utilize their Claude-code/Gemini CLI subscription via OpenHands.

Challenge: How do we make microagents, etc., work there? It will be a bit tricky unless we integrate the Agent-Client Protocol more deeply into the SDK.

Approach

One thing we can potentially do would be to create an ACPAgent that inherits from AgentBase -- we input the same stuff to the agent, but internally inside the agent, we implement the "agent" as an ACP Client & have Claude-Code/Gemini being an ACP Server.

Because we manage stuff like microagents at the conversation-state-level, we can make them work by assemble inputs to these different ACP servers

It is ok that we don't yet support most of the stuff within SDK - as long as we throw errors when user tries to set them.

Activity

  1. xingyaoww commented on Nov 10, 2025

    @xingyaoww
    ContributorAuthor

    @OpenHands please review this proposal and come up with a minimal example of getting ACPAgent to work within the software agent sdk

  2. openhands-ai commented on Nov 10, 2025

    @openhands-ai

    I'm on it! xingyaoww can track my progress at all-hands.dev

  3. added a commit that references this issue on Nov 10, 2025
    273bf37
  4. openhands-ai commented on Nov 10, 2025

    @openhands-ai

    Summary

    I've successfully implemented a minimal ACPAgent for the OpenHands SDK to support the Agent-Client Protocol (ACP). Here's what was created:

    ✅ Implementation Complete

    New Files:

    1. openhands-sdk/openhands/sdk/agent/acp_agent.py (332 lines)

      • Inherits from AgentBase for SDK integration
      • Implements JSON-RPC 2.0 communication over stdin/stdout
      • Manages ACP server subprocess lifecycle
      • Handles session initialization and prompt/response flow
      • Validates features and raises NotImplementedError for unsupported ones (tools, MCP, microagents, security analyzers, condensers)
    2. tests/sdk/agent/test_acp_agent.py (90 lines)

      • 5 comprehensive unit tests (all passing ✅)
      • Tests initialization, optional parameters, feature validation, and subprocess management
    3. examples/01_standalone_sdk/27_acp_agent_example.py (76 lines)

      • Complete working example using claude-code-acp
      • Demonstrates agent creation, conversation setup, and message exchange

    Modified Files:

    • openhands-sdk/openhands/sdk/agent/__init__.py: Exported ACPAgent

    🎯 Key Features

    • Protocol Support: JSON-RPC 2.0 over stdin/stdout following ACP specification
    • Subprocess Management: Handles ACP server lifecycle (start, communicate, terminate)
    • SDK Integration: Works with Conversation, ConversationState, and event system
    • Feature Validation: Clear errors for unsupported features as requested
    • Zero New Dependencies: Uses only standard library modules

    ✅ Testing & Quality

    • All 5 ACPAgent tests passing
    • All 65 existing agent tests still passing
    • Pre-commit hooks pass (ruff, pycodestyle, pyright)
    • Follows repository conventions

    📦 Pull Request

    PR created: #1122 (draft)

    The PR includes comprehensive documentation of the architecture, usage, testing, and future work. This is a minimal implementation as requested in issue #590 - it provides the foundation for ACP protocol support while clearly identifying unsupported features for future enhancement.

    View full conversation

  5. jpelletier1 commented on Nov 18, 2025

    @jpelletier1
    Contributor

    @xingyaoww Would the OpenHands Agent play any role in 'orchestrating' one or many third-party agents (Claude, Codex, etc.)? For example, could you write an OpenHands Skill with instructions to run third-party agents?

    Take me through a scenario where a user logs into OpenHands GUI on a self-hosted server. How would they 'activate' or use this feature?

  6. all-hands-bot commented on Dec 31, 2025

    @all-hands-bot
    Collaborator

    This issue is stale because it has been open for 40 days with no activity. Remove the stale label or leave a comment, otherwise it will be closed in 10 days.

  7. xingyaoww commented on Jan 12, 2026

    @xingyaoww
    ContributorAuthor

    Would the OpenHands Agent play any role in 'orchestrating' one or many third-party agents (Claude, Codex, etc.)? For example, could you write an OpenHands Skill with instructions to run third-party agents?

    I totally see this possibility - this can be done today already.

    How would they 'activate' or use this feature?

    This is the tricky part, as they need to log into the CLI via OAuth. One possible thing to do is that we build this into product, and have them login once, persist the credentials under ~ folder and mount the secret as read-only to each runtime container

  8. added 2 commits that reference this issue on Feb 19, 2026
    cdc2506
    53a4030
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions