fix: additional robustness improvements for plan and executor

- Fix plan.ts createPlan: filter empty strings from techStack after split/trim
- Fix executor.ts: re-check abort signal after waitIfPaused() in both execute() and executeTask()
  to prevent running additional tasks/steps after cancellation during pause

All 639 tests passing.
This commit is contained in:
Rohit Ghumare
2026-01-24 11:53:09 +00:00
parent b3ba8eb59e
commit 6fc62f4e42
2 changed files with 15 additions and 1 deletions
+1 -1
View File
@@ -374,7 +374,7 @@ export class PlanCommand extends Command {
const plan = generator.createPlan(this.name, this.goal || 'Complete the project');
if (this.techStack) {
plan.techStack = this.techStack.split(',').map((s) => s.trim());
plan.techStack = this.techStack.split(',').map((s) => s.trim()).filter((s) => s !== '');
}
const markdown = generator.toMarkdown(plan);
+14
View File
@@ -89,6 +89,14 @@ export class PlanExecutor {
// Wait if paused
await this.waitIfPaused();
// Re-check if aborted after resuming from pause
if (this.abortController.signal.aborted) {
aborted = true;
result.success = false;
result.errors = [...(result.errors ?? []), 'Execution cancelled'];
break;
}
const task = plan.tasks.find((t) => t.id === taskId);
if (!task) continue;
@@ -195,6 +203,12 @@ export class PlanExecutor {
// Wait if paused
await this.waitIfPaused();
// Re-check if aborted after resuming from pause
if (this.abortController?.signal.aborted) {
errors.push('Execution aborted');
break;
}
// Report progress
options?.onProgress?.(task.id, step.number, `executing step ${step.number}`);