Skip to content

ACP Server Enum Selection Incorrectly Treated as Cancellation. #16

@Leoyzen

Description

@Leoyzen

Description

When using the ACP server (agentpool serve-acp), user selections from enum elicitation questions are incorrectly identified as cancellations.

Steps to Reproduce

  1. Start an ACP server with an agent that uses enum elicitation
  2. Present a question with multiple enum options (e.g., diagnostic questions)
  3. User selects a valid option (e.g., "启动时冒黑烟")
  4. Server responds with "User cancelled the request" instead of processing the selection

Expected Behavior

  • User selection should be processed correctly
  • Response should contain the selected value in the correct format

Actual Behavior

  • Response shows: "status": "completed", "content": "User cancelled the request"
  • Selection is ignored despite user choosing a valid option

Root Cause

The _handle_enum_elicitation_response() function in acp_server/input_provider.py returns:

ElicitResult(action="accept", content=selected_value)  # content is a string

But ElicitResult expects content to be a dict with a "value" key per MCP spec. This causes Pydantic validation to fail, throwing a ValidationError that gets caught and triggers the cancel fallback.

Affected Components

  • packages/agentpool/src/agentpool_server/acp_server/input_provider.py line 374
  • ACP server enum elicitation handling
  • QuestionTool response processing

Workaround

None available - users are unable to complete enum elicitation flows.

Additional Context

The OpenCode server implementation (opencode_server/input_provider.py) correctly wraps the content in dict format:

ElicitResult(action="accept", content={"value": answer})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions