Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): thread lists load beyond SQLite variable limit #25696

Mergedjuliusmarmingemerged 6 commits intomain fromrefs/pull/25696/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 71 additions and 7 deletions.

x
0 of 2 viewed, 2 left
64 additions and 0 deletionsapps/server/src/orchestration-v2/ProjectionStore.test.tsModified
View file
@@ -1318,6 +1318,70 @@
}).pipe(Effect.provide(layerTest)),
+// regression: #25621 SQLite rejects statements binding more than 32,766 variables
+it.effect("lists every thread in the shell snapshot past SQLite's bound variable limit", () =>
+ Effect.gen(function* () {
+ const store = yield* ProjectionStore.ProjectionStoreV2;
+ const sql = yield* SqlClient.SqlClient;
+ const now = yield* DateTime.now;
+ const templateId = ThreadId.make("thread:many:00000");
+ yield* store.apply({
+ id: EventId.make(`event:${templateId}:created`),
+ type: "thread.created",
+ threadId: templateId,
+ occurredAt: now,
+ payload: {
+ createdBy: "user",
+ creationSource: "web",
+ id: templateId,
+ projectId: ProjectId.make("project:many"),
+ title: "Many",
+ providerInstanceId,
+ modelSelection,
+ runtimeMode: "full-access",
+ interactionMode: "default",
+ branch: null,
+ worktreePath: null,
+ activeProviderThreadId: null,
+ lineage: { parentThreadId: null, relationshipToParent: null, rootThreadId: templateId },