fix(FN-4606): honor configured worktreesDir in runtime and cleanup paths

Ref: Runfusion/Fusion#321
Fusion-Task-Id: FN-4606
Fusion-Task-Lineage: 94b23f37-944e-4bcd-bfa1-67d0a8c0a267
This commit is contained in:
Fusion
2026-05-15 08:18:49 -07:00
committed by gsxdsm
parent 2799c101ac
commit 8032f6c3cc
4 changed files with 10 additions and 8 deletions

View File

@@ -212,8 +212,9 @@ export class InProcessRuntime
// ensures scanIdleWorktrees / rehydrate never sees broken entries, and
// prevents assertValidWorktreeSession from permanently blocking retries.
const { reapOrphanWorktrees, scanIdleWorktrees } = await import("../worktree-pool.js");
const settings = await this.taskStore.getSettings();
try {
const reaped = await reapOrphanWorktrees(this.config.workingDirectory);
const reaped = await reapOrphanWorktrees(this.config.workingDirectory, settings);
if (reaped > 0) {
runtimeLog.log(`Reaped ${reaped} half-initialized orphan worktree(s) on startup`);
}
@@ -236,7 +237,8 @@ export class InProcessRuntime
// Rehydrate pool from disk state (idle worktrees)
const idleWorktrees = await scanIdleWorktrees(
this.config.workingDirectory,
this.taskStore
this.taskStore,
settings,
);
if (idleWorktrees.length > 0) {
this.worktreePool.rehydrate(idleWorktrees);