mirror of
https://github.com/rohitg00/skillkit.git
synced 2026-11-18 18:04:26 +00:00
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:
@@ -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);
|
||||
|
||||
@@ -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}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user