@convex-dev/agent 0.1.8-alpha.1 → 0.1.8-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -131,6 +131,9 @@ export const deleteAllForThreadIdSync = action({
131
131
  }
132
132
  cursor = result.cursor;
133
133
  }
134
+ await ctx.runAction(api.streams.deleteAllStreamsForThreadIdSync, {
135
+ threadId: args.threadId,
136
+ });
134
137
  },
135
138
  returns: v.null(),
136
139
  });
@@ -154,6 +157,11 @@ export const deleteAllForThreadIdAsync = mutation({
154
157
  threadId: args.threadId,
155
158
  cursor: result.cursor,
156
159
  });
160
+ } else {
161
+ // Kick off the streams deletion
162
+ await ctx.scheduler.runAfter(0, api.threads.deleteAllForThreadIdSync, {
163
+ threadId: args.threadId,
164
+ });
157
165
  }
158
166
  return result;
159
167
  },
@@ -156,6 +156,7 @@ async function deletePageForUserId(
156
156
  });
157
157
  await Promise.all(messages.page.map((m) => deleteMessage(ctx, m)));
158
158
  if (messages.isDone) {
159
+ // TODO: delete streams - maybe use workpool?
159
160
  await ctx.db.delete(threadInProgress);
160
161
  threadInProgress = null;
161
162
  messagesCursor = null;