Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): clean up deleted threads worktrees with subagents #23900

Mergedjuliusmarmingemerged 4 commits intomain fromrefs/pull/23900/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 106 additions and 6 deletions (loading 1).

x
0 of 2 viewed, 2 left
106 additions and 6 deletionsapps/server/src/storageCleanup.test.tsModified
View file
@@ -262,6 +262,7 @@
storageCleanup,
let threads = [shell({ branch: "feature", worktreePath: worktree })];
+ let deletedThreads: OrchestrationV2ThreadShell[] = [];
let storedWorktreePaths: string[] = [worktree];
let projectRoots = [repo];
let editBeforeRemoval = false;
@@ -358,12 +359,17 @@
}),
- : strings.join("").includes('AS "worktreePath"')
- ? [
- ...threads.flatMap((thread) => thread.worktreePath ?? []),
- ...storedWorktreePaths,
- ].map((worktreePath) => ({ worktreePath }))
- : [],
+ : strings.join("").includes("deleted_at IS NOT NULL")
+ ? deletedThreads.map((thread) => ({
+ payload_json: JSON.stringify(thread),
+ workspaceRoot: repo,
+ }))
+ : strings.join("").includes('AS "worktreePath"')
+ ? [
+ ...threads.flatMap((thread) => thread.worktreePath ?? []),
+ ...storedWorktreePaths,
+ ].map((worktreePath) => ({ worktreePath }))
+ : [],