Skip to content

feat(opencode): expose POST /question/ask for plugins and SDK#38896

Open
AuYahyire wants to merge 1 commit into
anomalyco:devfrom
AuYahyire:feat/question-ask
Open

feat(opencode): expose POST /question/ask for plugins and SDK#38896
AuYahyire wants to merge 1 commit into
anomalyco:devfrom
AuYahyire:feat/question-ask

Conversation

@AuYahyire

@AuYahyire AuYahyire commented Jul 25, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #8384

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Plugins and the SDK can already reply to questions (POST /question/:requestID/reply), but they cannot start one: Question.ask is only reachable from the built-in question tool.

This adds a blocking POST /question/ask that calls the same Question.ask path, so a plugin can open the native question UI and get the answers back on the HTTP response.

How did you verify your code works?

Called POST /question/ask from an in-process OpenCode client (client._client.post({ path: "/question/ask", ... })). The native question dialog appeared in the TUI; answering it returned the selected options on the HTTP response. A raw fetch to localhost:4096 did not work from inside the same process (connection refused); the SDK client path did.

Screenshots / recordings

N/A — no UI change; reuses the existing question dialog.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Plugins cannot trigger the native question TUI today because Question.ask is only reachable from the built-in question tool. Add a blocking HTTP endpoint that publishes question.asked and returns answers when the client replies.

Closes anomalyco#8384
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Jul 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Expose Question.ask for API/SDK to use

1 participant