fix: prevent infinite loop when resuming feature with existing context

When executeFeatureWithContext calls executeFeature with a continuation
prompt, skip the context existence check to avoid the loop:
executeFeature -> resumeFeature -> executeFeatureWithContext -> executeFeature

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Kacper
2025-12-18 16:22:20 +01:00
parent 50fb7ece4f
commit 516f26edae

View File

@@ -487,6 +487,8 @@ export class AutoModeService {
try { try {
// Check if feature has existing context - if so, resume instead of starting fresh // Check if feature has existing context - if so, resume instead of starting fresh
// Skip this check if we're already being called with a continuation prompt (from resumeFeature)
if (!options?.continuationPrompt) {
const hasExistingContext = await this.contextExists( const hasExistingContext = await this.contextExists(
projectPath, projectPath,
featureId featureId
@@ -499,6 +501,7 @@ export class AutoModeService {
this.runningFeatures.delete(featureId); this.runningFeatures.delete(featureId);
return this.resumeFeature(projectPath, featureId, useWorktrees); return this.resumeFeature(projectPath, featureId, useWorktrees);
} }
}
// Emit feature start event early // Emit feature start event early
this.emitAutoModeEvent("auto_mode_feature_start", { this.emitAutoModeEvent("auto_mode_feature_start", {