Repository navigation
Conversation
This commit introduces ACPAgent, a minimal Agent-Client Protocol (ACP) client implementation that enables OpenHands SDK to communicate with ACP servers like Claude-Code and Gemini CLI. Key features: - Implements AgentBase with ACP protocol support - JSON-RPC 2.0 communication via stdin/stdout - Subprocess management for ACP servers - Session initialization and prompt/response flow - Feature validation (raises NotImplementedError for unsupported features) Files added: - openhands-sdk/openhands/sdk/agent/acp_agent.py: Main implementation - tests/sdk/agent/test_acp_agent.py: Unit tests - examples/01_standalone_sdk/27_acp_agent_example.py: Usage example Files modified: - openhands-sdk/openhands/sdk/agent/__init__.py: Export ACPAgent This is a minimal implementation focusing on basic protocol support. Advanced features like microagents, custom tools, and security analyzers are not yet supported. Fixes #590 Co-authored-by: openhands <openhands@all-hands.dev>
Contributor
Coverage Report •
|
||||||||||||||||||||
ACP servers like Claude-Code and Gemini CLI manage their own LLM configuration internally, so the LLM parameter is not needed. Changes: - Override llm field in ACPAgent to be optional (default=None) - Update all tests to not require LLM when creating ACPAgent - Update example to remove LLM import and usage - Add documentation explaining ACP servers manage their own LLM All tests pass (5/5 ACPAgent tests, 65/65 agent tests total). Co-authored-by: openhands <openhands@all-hands.dev>
- Replaced manual JSON-RPC implementation with official SDK's ClientSideConnection - Added agent-client-protocol as optional dependency under [acp] extra - Implemented _OpenHandsACPClient using SDK's Client interface - Used SDK's typed protocol models (InitializeRequest, NewSessionRequest, PromptRequest) - Simplified code by leveraging SDK's helper functions (text_block, PROTOCOL_VERSION) - Updated tests to handle optional SDK dependency gracefully - All 65 agent tests passing The SDK-based implementation provides: - Better type safety with official protocol models - Automatic protocol version management - Built-in JSON-RPC handling - More maintainable codebase Co-authored-by: openhands <openhands@all-hands.dev>
|
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
Contributor
|
[Automatic Post]: It has been a while since there was any activity on this PR. @xingyaoww, are you still working on it? If so, please go ahead, if not then please request review, close it, or request that someone else follow up. |
1 similar comment
Contributor
|
[Automatic Post]: It has been a while since there was any activity on this PR. @xingyaoww, are you still working on it? If so, please go ahead, if not then please request review, close it, or request that someone else follow up. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements a minimal ACPAgent that enables OpenHands to work with Agent-Client Protocol (ACP) servers like Claude-Code and Gemini CLI.
Key Features
Uses Official ACP Python SDK
agent-client-protocolPython SDK (https://github.com/agentclientprotocol/python-sdk)ClientSideConnectionfor process management and communicationInitializeRequest,NewSessionRequest,PromptRequest)LLM-Optional Architecture
AgentBasebut bypasses OpenHands' LLM-based agent logicpip install openhands-sdk[acp]Current Limitations
Implementation Details
Testing
Example Usage
Future Work
Closes #590
Agent Server images for this PR
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdknikolaik/python-nodejs:python3.12-nodejs22golang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:b990b34-pythonRun
All tags pushed for this build
About Multi-Architecture Support
b990b34-python) is a multi-arch manifest supporting both amd64 and arm64b990b34-python-amd64) are also available if needed