feat(FN-4753): complete Step 3 — migrate step-session worktree removal
Fusion-Task-Id: FN-4753 Fusion-Task-Lineage: 8229b56a-8997-4faf-8872-18e49b9386ff
This commit is contained in:
committed by
gsxdsm
parent
2f8719573d
commit
0fc2b9e6b2
@@ -48,6 +48,7 @@ import {
|
|||||||
createTaskDocumentWriteTool,
|
createTaskDocumentWriteTool,
|
||||||
createTaskLogTool,
|
createTaskLogTool,
|
||||||
} from "./agent-tools.js";
|
} from "./agent-tools.js";
|
||||||
|
import { removeWorktree } from "./worktree-backend.js";
|
||||||
|
|
||||||
const stepExecLog = createLogger("step-session-executor");
|
const stepExecLog = createLogger("step-session-executor");
|
||||||
|
|
||||||
@@ -752,8 +753,11 @@ export class StepSessionExecutor {
|
|||||||
for (const [stepIdx, worktreePath] of this.parallelWorktrees) {
|
for (const [stepIdx, worktreePath] of this.parallelWorktrees) {
|
||||||
try {
|
try {
|
||||||
if (existsSync(worktreePath)) {
|
if (existsSync(worktreePath)) {
|
||||||
await execAsync(`git worktree remove "${worktreePath}" --force`, {
|
await removeWorktree({
|
||||||
cwd: this.options.rootDir,
|
worktreePath,
|
||||||
|
rootDir: this.options.rootDir,
|
||||||
|
settings: this.options.settings,
|
||||||
|
taskId: this.options.taskDetail.id,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
stepExecLog.warn(`Parallel worktree for step ${stepIdx} already removed: ${worktreePath}`);
|
stepExecLog.warn(`Parallel worktree for step ${stepIdx} already removed: ${worktreePath}`);
|
||||||
@@ -1244,8 +1248,11 @@ Follow instructions precisely and avoid unrelated changes.`,
|
|||||||
if (worktreePath !== this.options.worktreePath) {
|
if (worktreePath !== this.options.worktreePath) {
|
||||||
try {
|
try {
|
||||||
if (existsSync(worktreePath)) {
|
if (existsSync(worktreePath)) {
|
||||||
await execAsync(`git worktree remove "${worktreePath}" --force`, {
|
await removeWorktree({
|
||||||
cwd: this.options.rootDir,
|
worktreePath,
|
||||||
|
rootDir: this.options.rootDir,
|
||||||
|
settings: this.options.settings,
|
||||||
|
taskId: this.options.taskDetail.id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const branch = this.parallelBranches.get(stepIdx);
|
const branch = this.parallelBranches.get(stepIdx);
|
||||||
|
|||||||
Reference in New Issue
Block a user