Просмотр исходного кода

fix question request schema encoding

Decode pending question requests through the Schema.Class constructor path so the HttpApi list endpoint returns valid Question.Request instances while keeping QuestionID as a newtype.
Kit Langton 1 неделя назад
Родитель
Сommit
dd34bd8203
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      packages/opencode/src/question/index.ts

+ 2 - 2
packages/opencode/src/question/index.ts

@@ -161,12 +161,12 @@ export namespace Question {
         log.info("asking", { id, questions: input.questions.length })
 
         const deferred = yield* Deferred.make<ReadonlyArray<Answer>, RejectedError>()
-        const info: Request = {
+        const info = Schema.decodeUnknownSync(Request)({
           id,
           sessionID: input.sessionID,
           questions: input.questions,
           tool: input.tool,
-        }
+        })
         pending.set(id, { info, deferred })
         yield* bus.publish(Event.Asked, info)