mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-03 21:03:08 +00:00
feat: update resumeFeature API to support optional useWorktrees parameter
- Modified the resumeFeature method across multiple files to accept an optional useWorktrees parameter, defaulting to false for improved control over worktree usage. - Updated related hooks and service methods to ensure consistent handling of the new parameter. - Enhanced server route logic to reflect the change, ensuring worktrees are only utilized when explicitly enabled.
This commit is contained in:
@@ -342,7 +342,8 @@ export function useBoardActions({
|
|||||||
|
|
||||||
const result = await api.autoMode.resumeFeature(
|
const result = await api.autoMode.resumeFeature(
|
||||||
currentProject.path,
|
currentProject.path,
|
||||||
feature.id
|
feature.id,
|
||||||
|
useWorktrees
|
||||||
);
|
);
|
||||||
|
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
@@ -356,7 +357,7 @@ export function useBoardActions({
|
|||||||
await loadFeatures();
|
await loadFeatures();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[currentProject, loadFeatures]
|
[currentProject, loadFeatures, useWorktrees]
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleManualVerify = useCallback(
|
const handleManualVerify = useCallback(
|
||||||
|
|||||||
@@ -233,7 +233,8 @@ export interface AutoModeAPI {
|
|||||||
) => Promise<{ success: boolean; passes?: boolean; error?: string }>;
|
) => Promise<{ success: boolean; passes?: boolean; error?: string }>;
|
||||||
resumeFeature: (
|
resumeFeature: (
|
||||||
projectPath: string,
|
projectPath: string,
|
||||||
featureId: string
|
featureId: string,
|
||||||
|
useWorktrees?: boolean
|
||||||
) => Promise<{ success: boolean; passes?: boolean; error?: string }>;
|
) => Promise<{ success: boolean; passes?: boolean; error?: string }>;
|
||||||
contextExists: (
|
contextExists: (
|
||||||
projectPath: string,
|
projectPath: string,
|
||||||
@@ -1464,7 +1465,7 @@ function createMockAutoModeAPI(): AutoModeAPI {
|
|||||||
return { success: true, passes: true };
|
return { success: true, passes: true };
|
||||||
},
|
},
|
||||||
|
|
||||||
resumeFeature: async (projectPath: string, featureId: string) => {
|
resumeFeature: async (projectPath: string, featureId: string, useWorktrees?: boolean) => {
|
||||||
if (mockRunningFeatures.has(featureId)) {
|
if (mockRunningFeatures.has(featureId)) {
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
|
|||||||
@@ -536,8 +536,8 @@ export class HttpApiClient implements ElectronAPI {
|
|||||||
}),
|
}),
|
||||||
verifyFeature: (projectPath: string, featureId: string) =>
|
verifyFeature: (projectPath: string, featureId: string) =>
|
||||||
this.post("/api/auto-mode/verify-feature", { projectPath, featureId }),
|
this.post("/api/auto-mode/verify-feature", { projectPath, featureId }),
|
||||||
resumeFeature: (projectPath: string, featureId: string) =>
|
resumeFeature: (projectPath: string, featureId: string, useWorktrees?: boolean) =>
|
||||||
this.post("/api/auto-mode/resume-feature", { projectPath, featureId }),
|
this.post("/api/auto-mode/resume-feature", { projectPath, featureId, useWorktrees }),
|
||||||
contextExists: (projectPath: string, featureId: string) =>
|
contextExists: (projectPath: string, featureId: string) =>
|
||||||
this.post("/api/auto-mode/context-exists", { projectPath, featureId }),
|
this.post("/api/auto-mode/context-exists", { projectPath, featureId }),
|
||||||
analyzeProject: (projectPath: string) =>
|
analyzeProject: (projectPath: string) =>
|
||||||
|
|||||||
3
apps/app/src/types/electron.d.ts
vendored
3
apps/app/src/types/electron.d.ts
vendored
@@ -359,7 +359,8 @@ export interface AutoModeAPI {
|
|||||||
|
|
||||||
resumeFeature: (
|
resumeFeature: (
|
||||||
projectPath: string,
|
projectPath: string,
|
||||||
featureId: string
|
featureId: string,
|
||||||
|
useWorktrees?: boolean
|
||||||
) => Promise<{
|
) => Promise<{
|
||||||
success: boolean;
|
success: boolean;
|
||||||
passes?: boolean;
|
passes?: boolean;
|
||||||
|
|||||||
@@ -29,8 +29,9 @@ export function createResumeFeatureHandler(autoModeService: AutoModeService) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Start resume in background
|
// Start resume in background
|
||||||
|
// Default to false - worktrees should only be used when explicitly enabled
|
||||||
autoModeService
|
autoModeService
|
||||||
.resumeFeature(projectPath, featureId, useWorktrees ?? true)
|
.resumeFeature(projectPath, featureId, useWorktrees ?? false)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
logger.error(`[AutoMode] Resume feature ${featureId} error:`, error);
|
logger.error(`[AutoMode] Resume feature ${featureId} error:`, error);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -31,8 +31,9 @@ export function createRunFeatureHandler(autoModeService: AutoModeService) {
|
|||||||
|
|
||||||
// Start execution in background
|
// Start execution in background
|
||||||
// If worktreePath is provided, use it directly; otherwise let the service decide
|
// If worktreePath is provided, use it directly; otherwise let the service decide
|
||||||
|
// Default to false - worktrees should only be used when explicitly enabled
|
||||||
autoModeService
|
autoModeService
|
||||||
.executeFeature(projectPath, featureId, useWorktrees ?? true, false, worktreePath)
|
.executeFeature(projectPath, featureId, useWorktrees ?? false, false, worktreePath)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
logger.error(`[AutoMode] Feature ${featureId} error:`, error);
|
logger.error(`[AutoMode] Feature ${featureId} error:`, error);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ export class AutoModeService {
|
|||||||
async executeFeature(
|
async executeFeature(
|
||||||
projectPath: string,
|
projectPath: string,
|
||||||
featureId: string,
|
featureId: string,
|
||||||
useWorktrees = true,
|
useWorktrees = false,
|
||||||
isAutoMode = false,
|
isAutoMode = false,
|
||||||
providedWorktreePath?: string
|
providedWorktreePath?: string
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
@@ -352,7 +352,7 @@ export class AutoModeService {
|
|||||||
async resumeFeature(
|
async resumeFeature(
|
||||||
projectPath: string,
|
projectPath: string,
|
||||||
featureId: string,
|
featureId: string,
|
||||||
useWorktrees = true
|
useWorktrees = false
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
// Check if context exists in .automaker directory
|
// Check if context exists in .automaker directory
|
||||||
const featureDir = getFeatureDir(projectPath, featureId);
|
const featureDir = getFeatureDir(projectPath, featureId);
|
||||||
|
|||||||
Reference in New Issue
Block a user