Skip to content

Add Elicitation SDK support and fix generated Python types #109

@Nemtecl

Description

@Nemtecl

Add elicitation SDK support and fix generated Python types

The Python SDK currently has partial elicitation support from the generated ACP schema, but it is not usable end-to-end.

The repo is on ACP schema refs/tags/v0.13.3. That schema already includes unstable elicitation support, so this likely does not require a schema bump unless newer ACP releases changed elicitation semantics.

What exists today

schema/meta.json / src/acp/meta.py already include:

  • elicitation_create: elicitation/create
  • elicitation_complete: elicitation/complete

schema/schema.json also defines:

  • CreateElicitationRequest
  • CreateElicitationResponse
  • CompleteElicitationNotification
  • ElicitationCapabilities
  • form/url modes and property schemas

Generated type problem

The generated Python types for concrete create requests appear incomplete.

In schema/schema.json, CreateElicitationRequest is a discriminated oneOf over form and URL modes. The form/url variants compose common request fields with mode-specific schemas via allOf.

But in src/acp/schema.py, the generated classes:

  • CreateFormElicitationRequest
  • CreateUrlElicitationRequest

only contain:

  • _meta
  • message
  • mode

They drop the mode-specific fields needed to construct valid requests, such as:

  • sessionId / requestId
  • toolCallId
  • requestedSchema
  • elicitationId
  • url

The generated mode classes do contain those fields (ElicitationFormSessionMode, ElicitationUrlSessionMode, etc.), but the top-level generated request variants are not usable as complete request payload types.

Runtime support missing

The runtime also does not wire elicitation through the SDK:

  • Client protocol has no create_elicitation handler.
  • Client protocol has no complete_elicitation notification handler.
  • AgentSideConnection cannot send elicitation/create.
  • AgentSideConnection cannot send elicitation/complete.
  • build_client_router does not route elicitation/create or elicitation/complete.
  • acp.__init__ does not export the elicitation request/response/capability types.
  • There are no RPC/golden tests covering elicitation request, response, or completion notification round trips.

Suggested shape

Because schema files are generated, we should not manually edit generated schema output.

Possible SDK API:

await client_conn.create_elicitation(
    message="Need deployment target",
    mode=ElicitationFormSessionMode(
        session_id="sess",
        requested_schema=ElicitationSchema(...),
    ),
)

Where mode accepts:

  • ElicitationFormSessionMode
  • ElicitationFormRequestMode
  • ElicitationUrlSessionMode
  • ElicitationUrlRequestMode

The SDK can compose the wire payload from message, mode, and the discriminator value (form or url) instead of relying on the incomplete generated CreateFormElicitationRequest / CreateUrlElicitationRequest classes.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions