Skip to content

feat(opencode): bridge question tool to ACP elicitation - #42104

Closed
pjaol wants to merge 1 commit into
anomalyco:devfrom
thevgergroup:acp-elicitation-support
Closed

pjaol wants to merge 1 commit into
anomalyco:devfrom
thevgergroup:acp-elicitation-support

Conversation

@pjaol

@pjaol pjaol commented Aug 12, 2026

Copy link
Copy Markdown

Summary

  • Adds packages/opencode/src/acp/elicitation.ts — a handler (modelled on permission.ts) that translates the question tool part into an unstable_createElicitation ACP request and maps the client response back to sdk.question.reply/reject
  • Wires the handler into ACPEvent.Subscription.handleToolPart — when toolName === "question" and the state is running, the elicitation handler fires instead of the normal runningTool path
  • Extends the Connection type in both event.ts and service.ts to include unstable_createElicitation
  • Preserves the auto-reject fallback when the client does not advertise elicitation support

Test plan

  • Accepted elicitation — form schema is correct, answers are mapped back and sdk.question.reply is called
  • Declined elicitation — sdk.question.reject is called
  • Cancelled elicitation — sdk.question.reject is called
  • Client without elicitation support — auto-rejects immediately without calling unstable_createElicitation
  • unstable_createElicitation throws — falls back to reject
  • Multiple questions in one tool call — all map into a single form with one property per question
  • Multi-select question (multiple: true) — uses array schema with anyOf items
  • Unknown session — handler exits early, no calls made
  • Full ACP test suite passes (136 tests)

Fixes #38121

When the LLM calls the built-in question tool, forward it to the ACP
client as an unstable_createElicitation request so the client can render
a structured form. Translate accept/decline/cancel back to
sdk.question.reply/reject to unblock the waiting tool execution.

Falls back to auto-reject when the client does not advertise elicitation
support, preserving the existing behaviour for non-elicitation clients.

Fixes anomalyco#38121
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Aug 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@pjaol

pjaol commented Aug 12, 2026

Copy link
Copy Markdown
Author

Closing — work in progress, not ready for upstream review yet. Will reopen when complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:compliance This means the issue will auto-close after 2 hours.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ACP: support elicitation for V2 forms and questions

1 participant