mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-18 10:07:58 +00:00
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.
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user