Add ask_agent support to ACPAgent via fork_session#2145
Conversation
Coverage Report •
|
|||||||||||||||||||||||||||||||||||
d5c43b1 to
506a50a
Compare
684bc6e to
39f6a03
Compare
all-hands-bot
left a comment
There was a problem hiding this comment.
🟢 Good taste - Clean solution that leverages fork_session to implement stateless Q&A. The design is pragmatic: uses the protocol's native capability rather than fighting the sentinel LLM limitation. Session-based routing keeps concerns separated (client handles dispatch, agent handles business logic). Well-tested with comprehensive coverage of error cases, token tracking, and cleanup. LGTM! 👍
d1a3a65 to
8788f63
Compare
|
@malhotra5 will make an issue to see if |
8788f63 to
12daf31
Compare
|
@OpenHands /codereview-roasted read the PR diff |
|
I'm on it! simonrosenberg can track my progress at all-hands.dev |
SummaryI performed a Linus Torvalds-style code review of PR #2145 "Add ask_agent support to ACPAgent via fork_session" as requested with Review Verdict: 🟡 Acceptable - ✅ Worth MergingThe PR solves a real problem correctly: ACPAgent's sentinel LLM can't make real LLM calls, so using the ACP protocol's Key Feedback Provided:Critical Issues:
Improvement Opportunities:
Testing: Tests are thorough at the unit level but heavily mocked. Acknowledged that true integration testing of subprocess/ACP protocol is difficult. No Code Changes MadeThis was a review-only task per the |
The ask_agent API (stateless question answering) failed for ACPAgent because its sentinel LLM can't make real LLM calls. This uses the ACP protocol's fork_session to create a temporary copy of the session, prompt it, collect the response, and discard the fork — preserving read-only semantics. - Add AgentBase.ask_agent() default method (returns None → use LLM path) - Override in ACPAgent with fork_session logic + token usage tracking - Add fork text routing in _OpenHandsACPClient.session_update() - Dispatch agent override in LocalConversation.ask_agent() - Add 7 tests for ask_agent and fork text routing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
af8df4e to
2f59de1
Compare
The ask_agent API (stateless question answering) failed for ACPAgent because its sentinel LLM can't make real LLM calls. This uses the ACP protocol's fork_session to create a temporary copy of the session, prompt it, collect the response, and discard the fork — preserving read-only semantics.
Summary
[fill in a summary of this PR]
Checklist
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:0729c45-pythonRun
All tags pushed for this build
About Multi-Architecture Support
0729c45-python) is a multi-arch manifest supporting both amd64 and arm640729c45-python-amd64) are also available if needed