We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b19e1ca commit bcfbcacCopy full SHA for bcfbcac
1 file changed
apps/backend-convex/convex/http/ai.ts
@@ -99,7 +99,7 @@ aiApp
99
100
// Cast type and runQuery to check for permission
101
const threadId = _threadId as Id<'threads'>
102
- const _thread = await c.env.runQuery(api.threads.get, { threadId, lockerKey })
+ const thread = await c.env.runQuery(api.threads.get, { threadId, lockerKey })
103
104
let streamId: string
105
let streamingMessageId: Id<'messages'>
@@ -133,6 +133,9 @@ aiApp
133
}
134
135
else if (content) {
136
+ if (thread.frozen)
137
+ throw new ConvexError(`Can't send new messages to frozen thread`)
138
+
139
// Create new streaming session
140
streamId = `${Date.now()}_${randomStr(10)}`
141
0 commit comments