Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): worktree cleanup no longer runs sweeps back to back #17480

Closedfireboltdude1357(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/17480/headopened View on GitHub

Showing 6 changed files with 105 additions and 0 deletions (loading 3).

x
0 of 6 viewed, 6 left
69 additions and 0 deletionsapps/server/src/orchestration-v2/ProjectionStore.test.tsModified
View file
@@ -327,6 +327,71 @@
assert.deepEqual(updated?.restartCancelledBackgroundWork, work);
});
​
+const threadWorktreePathsSkipDeletedThreads = Effect.gen(function* () {
+ const store = yield* ProjectionStore.ProjectionStoreV2;
+ const now = yield* DateTime.now;
+ const create = (id: string, input: { worktreePath: string | null; archived?: boolean }) => {
+ const threadId = ThreadId.make(id);
+ const thread = {
+ createdBy: "user" as const,
+ creationSource: "web" as const,
+ id: threadId,
+ projectId: ProjectId.make("project:worktree-paths"),
+ title: id,
+ providerInstanceId,
+ modelSelection,
+ runtimeMode: "full-access" as const,
+ interactionMode: "default" as const,
+ branch: input.worktreePath === null ? null : id,
+ worktreePath: input.worktreePath,
+ activeProviderThreadId: null,
+ lineage: { parentThreadId: null, relationshipToParent: null, rootThreadId: threadId },
+ forkedFrom: null,
+ createdAt: now,
+ updatedAt: now,
+ archivedAt: input.archived === true ? now : null,
+ settledOverride: null,
+ settledAt: null,
+ lastVisitedAt: null,