fix(session): type message list not found errors (#27275)
This commit is contained in:
@@ -1077,7 +1077,9 @@ NOTE: At any point in time through this workflow you should feel free to ask the
|
||||
...(current.model.variant && current.model.variant !== "default" ? { variant: current.model.variant } : {}),
|
||||
}
|
||||
}
|
||||
const match = yield* sessions.findMessage(sessionID, (m) => m.info.role === "user" && !!m.info.model)
|
||||
const match = yield* sessions
|
||||
.findMessage(sessionID, (m) => m.info.role === "user" && !!m.info.model)
|
||||
.pipe(Effect.orDie)
|
||||
if (Option.isSome(match) && match.value.info.role === "user") return match.value.info.model
|
||||
return yield* provider.defaultModel()
|
||||
})
|
||||
@@ -1615,9 +1617,9 @@ NOTE: At any point in time through this workflow you should feel free to ask the
|
||||
)
|
||||
|
||||
const lastAssistant = Effect.fnUntraced(function* (sessionID: SessionID) {
|
||||
const match = yield* sessions.findMessage(sessionID, (m) => m.info.role !== "user")
|
||||
const match = yield* sessions.findMessage(sessionID, (m) => m.info.role !== "user").pipe(Effect.orDie)
|
||||
if (Option.isSome(match)) return match.value
|
||||
const msgs = yield* sessions.messages({ sessionID, limit: 1 })
|
||||
const msgs = yield* sessions.messages({ sessionID, limit: 1 }).pipe(Effect.orDie)
|
||||
if (msgs.length > 0) return msgs[0]
|
||||
throw new Error("Impossible")
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user