Repository navigation
Conversation
Transforming the built-in `question` tool (`editor.update("question", ...)`)
made OpenCode 2.0.23 emit `form.created` without a `location`, so a
location-scoped client — every ordinary session — dropped the form and the
option list never rendered; the session hung waiting for an answer.
Stop touching `question` globally. Add a dedicated `workflow_question` tool
that routes a Unit's questions to the Run's broker, hide it outside Unit
sessions and hide the native `question` inside them via the `context` hook,
and tell Units to ask through it. Units now never raise a blocking native
form.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #17.
What and why
With the plugin loaded, the built-in
questiontool stopped rendering in the parent/main client window: the form was emitted but the option list never appeared, so the session hung. Reproducible in an ordinary session with no Workflow running — merely having the plugin connected was enough.Root cause: the plugin wrapped the built-in
questiontool withctx.tool.transform→editor.update("question", …). On OpenCode 2.0.23 that makesform.createdfire without alocation. A location-scoped client (every ordinary session) then drops the form, so the options never render. Even a no-op update triggered it;editor.update("bash", …)andeditor.add(…)did not.The fix stops transforming
questionglobally:workflow_questiontool that routes a Unit's questions through the Run's broker (broker-routed, so the answer reaches whatever surface is watching — TUI, web, or any RPC client — instead of a blocking native form);contexthook, hidesworkflow_questionoutside Unit sessions and hides the nativequestioninside Units;QUESTION_INSTRUCTIONto Units and allowsworkflow_question/ deniesquestioninENGINE_UNIT_RULES;execute.afterfallback hook.Ordinary sessions keep the untouched native
question, so its form renders with the fulllocation.How I tested it
bun run check— format, lint, typecheck, 292 tests, 0 fail.questiontool renders its options in the TUI ("1. Red / 2. Blue / 3. Type your own answer");form.createdcarrieslocation={directory:"/tmp/wf-repro"}.workflow_questionreports nobody available and the Unit proceeds (COLOUR=none).replyInteractionreturns the answer (COLOUR=Blue).Checklist
fix:)bun run checkpassesbun run schemas— no diff)