diff --git a/apps/app/src/components/views/board-view/hooks/use-board-actions.ts b/apps/app/src/components/views/board-view/hooks/use-board-actions.ts index 7cf3c71d..787b2ed2 100644 --- a/apps/app/src/components/views/board-view/hooks/use-board-actions.ts +++ b/apps/app/src/components/views/board-view/hooks/use-board-actions.ts @@ -342,7 +342,8 @@ export function useBoardActions({ const result = await api.autoMode.resumeFeature( currentProject.path, - feature.id + feature.id, + useWorktrees ); if (result.success) { @@ -356,7 +357,7 @@ export function useBoardActions({ await loadFeatures(); } }, - [currentProject, loadFeatures] + [currentProject, loadFeatures, useWorktrees] ); const handleManualVerify = useCallback( diff --git a/apps/app/src/lib/electron.ts b/apps/app/src/lib/electron.ts index 13606ee3..4787462e 100644 --- a/apps/app/src/lib/electron.ts +++ b/apps/app/src/lib/electron.ts @@ -233,7 +233,8 @@ export interface AutoModeAPI { ) => Promise<{ success: boolean; passes?: boolean; error?: string }>; resumeFeature: ( projectPath: string, - featureId: string + featureId: string, + useWorktrees?: boolean ) => Promise<{ success: boolean; passes?: boolean; error?: string }>; contextExists: ( projectPath: string, @@ -1464,7 +1465,7 @@ function createMockAutoModeAPI(): AutoModeAPI { return { success: true, passes: true }; }, - resumeFeature: async (projectPath: string, featureId: string) => { + resumeFeature: async (projectPath: string, featureId: string, useWorktrees?: boolean) => { if (mockRunningFeatures.has(featureId)) { return { success: false, diff --git a/apps/app/src/lib/http-api-client.ts b/apps/app/src/lib/http-api-client.ts index 8dbc5512..d43d8322 100644 --- a/apps/app/src/lib/http-api-client.ts +++ b/apps/app/src/lib/http-api-client.ts @@ -536,8 +536,8 @@ export class HttpApiClient implements ElectronAPI { }), verifyFeature: (projectPath: string, featureId: string) => this.post("/api/auto-mode/verify-feature", { projectPath, featureId }), - resumeFeature: (projectPath: string, featureId: string) => - this.post("/api/auto-mode/resume-feature", { projectPath, featureId }), + resumeFeature: (projectPath: string, featureId: string, useWorktrees?: boolean) => + this.post("/api/auto-mode/resume-feature", { projectPath, featureId, useWorktrees }), contextExists: (projectPath: string, featureId: string) => this.post("/api/auto-mode/context-exists", { projectPath, featureId }), analyzeProject: (projectPath: string) => diff --git a/apps/app/src/types/electron.d.ts b/apps/app/src/types/electron.d.ts index 3d45d4c4..aa244fbe 100644 --- a/apps/app/src/types/electron.d.ts +++ b/apps/app/src/types/electron.d.ts @@ -359,7 +359,8 @@ export interface AutoModeAPI { resumeFeature: ( projectPath: string, - featureId: string + featureId: string, + useWorktrees?: boolean ) => Promise<{ success: boolean; passes?: boolean; diff --git a/apps/server/src/routes/auto-mode/routes/resume-feature.ts b/apps/server/src/routes/auto-mode/routes/resume-feature.ts index 73007d91..94f5b056 100644 --- a/apps/server/src/routes/auto-mode/routes/resume-feature.ts +++ b/apps/server/src/routes/auto-mode/routes/resume-feature.ts @@ -29,8 +29,9 @@ export function createResumeFeatureHandler(autoModeService: AutoModeService) { } // Start resume in background + // Default to false - worktrees should only be used when explicitly enabled autoModeService - .resumeFeature(projectPath, featureId, useWorktrees ?? true) + .resumeFeature(projectPath, featureId, useWorktrees ?? false) .catch((error) => { logger.error(`[AutoMode] Resume feature ${featureId} error:`, error); }); diff --git a/apps/server/src/routes/auto-mode/routes/run-feature.ts b/apps/server/src/routes/auto-mode/routes/run-feature.ts index 056acbfd..da2f1f6c 100644 --- a/apps/server/src/routes/auto-mode/routes/run-feature.ts +++ b/apps/server/src/routes/auto-mode/routes/run-feature.ts @@ -31,8 +31,9 @@ export function createRunFeatureHandler(autoModeService: AutoModeService) { // Start execution in background // If worktreePath is provided, use it directly; otherwise let the service decide + // Default to false - worktrees should only be used when explicitly enabled autoModeService - .executeFeature(projectPath, featureId, useWorktrees ?? true, false, worktreePath) + .executeFeature(projectPath, featureId, useWorktrees ?? false, false, worktreePath) .catch((error) => { logger.error(`[AutoMode] Feature ${featureId} error:`, error); }); diff --git a/apps/server/src/services/auto-mode-service.ts b/apps/server/src/services/auto-mode-service.ts index 24212514..7d779da8 100644 --- a/apps/server/src/services/auto-mode-service.ts +++ b/apps/server/src/services/auto-mode-service.ts @@ -193,7 +193,7 @@ export class AutoModeService { async executeFeature( projectPath: string, featureId: string, - useWorktrees = true, + useWorktrees = false, isAutoMode = false, providedWorktreePath?: string ): Promise { @@ -352,7 +352,7 @@ export class AutoModeService { async resumeFeature( projectPath: string, featureId: string, - useWorktrees = true + useWorktrees = false ): Promise { // Check if context exists in .automaker directory const featureDir = getFeatureDir(projectPath, featureId);