Documentation
¶
Overview ¶
Example elicitation_callback demonstrates the agent-initiated elicitation path: WithOnElicitation receives elicitation/create requests from the agent and returns an Accept / Decline / Cancel response. This is the mirror of the tool-side Elicit helper shown in examples/elicitation (which goes tool → opencode MCP client → user). Here the agent asks the SDK user directly via ACP's unstable elicitation/create method.
opencode 1.14.20 does NOT currently emit elicitation/create over ACP — the schema reserves this method under the unstable namespace. Wiring the callback is forward-compatible: when opencode (or another ACP agent) starts emitting it, this handler will receive the requests. Until then the callback never fires.
Run:
go run ./examples/elicitation_callback