feat(acp): add elicitation/create JSON-RPC method with capability negotiation - #30
Conversation
Wave 1 complete: Add ElicitationCreateRequest, ElicitationCreateResponse, ElicitationCompleteNotification, URLElicitationRequiredError, and ElicitationCapabilities types to ACP schema layer. - elicitation.py: 4 core types with camelCase aliases - capabilities.py: ElicitationCapabilities on ClientCapabilities - agent_requests.py: ElicitationCreateRequest in AgentRequest union - client_responses.py: ElicitationCreateResponse in ClientResponse union - notifications.py: ElicitationCompleteNotification in ClientNotification union - messages.py: elicitation/create in ClientMethod Literal - __init__.py: All types exported
Remove unused noqa comments, fix import ordering, add missing docstring arg. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add elicitation_create() to Client protocol, ACPRequests, both connection handlers. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
DefaultACPClient auto-accepts with tracking, HeadlessACPClient gates on auto_grant, NoOpClient cancels. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Dual-path in ACPInputProvider: use elicitation_create when client declares capability, fall back to request_permission for legacy clients. Add send_elicitation_complete to ACPNotifications. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add openspec changes for acp-elicitation and acp-streamable-http-ws-server, plus .claude skills/commands for openspec workflows. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
There was a problem hiding this comment.
Code Review
This pull request introduces a native elicitation protocol to the Agent Client Protocol (ACP), allowing agents to request structured input from users. It includes new schema definitions, capability negotiation, and updates to both agent and client implementations to support the elicitation/create method. The server-side input provider is also updated to use this native method when available, with a fallback to the legacy permission-based approach. Feedback highlights a directional error in the implementation of elicitation completion notifications, which should be sent by the client rather than the agent. Additionally, the URL-based elicitation flow in the input provider needs to be updated to handle the asynchronous arrival of completion notifications.
This reverts commit bcc0d06. RFC docs should not have been deleted - they were unrelated working tree pollution from subagents. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
… async gap - Remove send_elicitation_complete from ACPNotifications: it was sending a ClientNotification (client→agent) in the wrong direction via session/update with type: ignore - Add elicitation/complete handler in agent connection to receive client notifications - Add TODO comment in input_provider explaining URL-mode async completion is deferred Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces experimental OPSX workflow commands and skills for managing change lifecycles, alongside a significant implementation of structured user input (elicitation) in the Agent Client Protocol (ACP). The ACP changes include new schema types, protocol methods, and a capability-gated input provider. Review feedback highlights the omission of the "elicitation_id" field in several new schema models and protocol methods, which is necessary for correlating requests and notifications. It was also suggested to explicitly include the RFC-specified error code in "URLElicitationRequiredError".
- Add elicitation_id field to ElicitationCreateRequest (required for URL mode correlation) - Restructure ElicitationCompleteNotification: Agent→Client direction, only elicitation_id field - Move ElicitationCompleteNotification from ClientNotification to AgentNotification - Add ElicitationItem schema and restructure URLElicitationRequiredError with code -32042 - Add elicitation_complete() to Client protocol and AgentSideConnection - Add send_elicitation_complete() to ACPNotifications with correct RFD structure - Add elicitation/complete handler to ClientSideConnection (receives Agent→Client) - Remove elicitation/complete from _agent_handler (no longer Client→Agent) - Pass elicitation_id in _get_url_elicitation - Add elicitation_complete stubs to all 3 client implementations Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
All Review Comments Resolved ✅All 8 review comments from Gemini Code Assist have been addressed and resolved: Round 1 (commit b415dc1)
Round 2 (commit d86ad65) — RFD Spec Alignment
Key Design DecisionAfter re-reading the ACP RFD spec, Verification
|
Summary
Add
elicitation/createJSON-RPC method support to agentpool as an ACP server, enabling proper structured user input with backward-compatible fallback torequest_permissionfor legacy clients.Key Changes
Wave 1 — Schema Types (already committed in
6aa2167f9)src/acp/schema/elicitation.pywith 4 types:ElicitationCreateRequest,ElicitationCreateResponse,ElicitationCompleteNotification,URLElicitationRequiredErrorElicitationCapabilities(create: bool)added toClientCapabilitiesAgentRequest,ClientResponse,ClientNotificationunions,ClientMethodliteral, and__init__.pyexportsWave 2 — Protocol & Routing
elicitation_create()method onClientprotocol,ACPRequests, and both connection handlers"elicitation/create"in_handle_client_method()Wave 3 — Server Integration
ACPInputProvider.get_elicitation(): useselicitation_createwhen client declares capability, falls back torequest_permissionhack for legacy clientssend_elicitation_complete()onACPNotifications_map_elicitation_create_response()static method for response mappingAccepted Plan Divergences (ACP Spec Alignment)
The implementation follows the actual ACP RFD specification, which differs from the original plan in these ways:
ElicitationCapabilities.create: boolinstead ofform: bool+url: boolmodefield onElicitationCreateRequest— URL mode determined byurlfield presenceElicitationCompleteNotificationinClientNotification(client→agent direction is correct per ACP spec)ElicitationCompleteNotificationhasaction/contentfollowing ACP response model patternTest plan
uv run mypy src/acp/ src/agentpool_server/acp_server/— 0 new errors (pre-existing in event_converter.py)uv run ruff check src/acp/ src/agentpool_server/acp_server/— 0 new errors (pre-existing in event_converter.py)uv run pytest tests/ -k "acp"— 190 passed, 2 pre-existing failuresacp.schemaaction=acceptaction=cancelACPInputProvider._client_supports_elicitation()checks capability correctlyUltraworked with Sisyphus