From 8fc02b0130718030304748520efc9329dfb5379a Mon Sep 17 00:00:00 2001 From: Kit Langton Date: Wed, 20 May 2026 23:06:22 -0400 Subject: [PATCH] refactor(question): tool-arg errors at the boundary, drop redundant inner decode (#28570) --- packages/opencode/src/question/index.ts | 59 +++++++------- packages/opencode/src/tool/tool.ts | 31 ++++++-- .../opencode/test/question/question.test.ts | 40 ---------- .../opencode/test/tool/tool-define.test.ts | 77 +++++++++++++++---- 4 files changed, 114 insertions(+), 93 deletions(-) diff --git a/packages/opencode/src/question/index.ts b/packages/opencode/src/question/index.ts index 38acf58e8f..ef871c8aa4 100644 --- a/packages/opencode/src/question/index.ts +++ b/packages/opencode/src/question/index.ts @@ -8,16 +8,20 @@ import { QuestionID } from "./schema" const log = Log.create({ service: "question" }) -// Schemas +// Schemas — these are pure data; nothing checks class identity (see PR +// description) so they're plain `Schema.Struct` + type alias. That lets +// `Question.ask` and other internal sites trust the type contract without a +// re-decode to coerce nested class instances. -export class Option extends Schema.Class