proper parallelization
This commit is contained in:
4
index.ts
4
index.ts
@@ -356,6 +356,10 @@ async function handleRun(
|
|||||||
const mode = await selectExecutionMode(ctx, project, taskFile);
|
const mode = await selectExecutionMode(ctx, project, taskFile);
|
||||||
const plan = buildPlanByMode(mode, project, completed);
|
const plan = buildPlanByMode(mode, project, completed);
|
||||||
|
|
||||||
|
// Show execution plan before starting so user can see batch breakdown
|
||||||
|
const formattedPlan = formatExecutionPlan(plan);
|
||||||
|
ctx.ui.notify(`${formattedPlan}\n\nStarting ${mode} execution...`, "info");
|
||||||
|
|
||||||
await executePlanBatches(
|
await executePlanBatches(
|
||||||
plan,
|
plan,
|
||||||
project,
|
project,
|
||||||
|
|||||||
@@ -74,6 +74,8 @@ export async function runTask(
|
|||||||
// Live progress widget above the editor — animated spinner + tool call tree
|
// Live progress widget above the editor — animated spinner + tool call tree
|
||||||
// Using setWidget instead of setWorkingMessage because the working message area
|
// Using setWidget instead of setWorkingMessage because the working message area
|
||||||
// is only visible during parent agent streaming, not during extension command execution.
|
// is only visible during parent agent streaming, not during extension command execution.
|
||||||
|
// Widget key is unique per task so parallel tasks each get their own widget.
|
||||||
|
const widgetKey = `ralph-task-${task.id}`;
|
||||||
const SPINNER_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
const SPINNER_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
||||||
let frameIndex = 0;
|
let frameIndex = 0;
|
||||||
const theme = ctx.ui.theme;
|
const theme = ctx.ui.theme;
|
||||||
@@ -102,7 +104,7 @@ export async function runTask(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.ui.setWidget("ralph-task", lines);
|
ctx.ui.setWidget(widgetKey, lines);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Smooth spinner animation at 100ms intervals
|
// Smooth spinner animation at 100ms intervals
|
||||||
@@ -138,7 +140,7 @@ export async function runTask(
|
|||||||
|
|
||||||
// Clear progress widget and status after task finishes
|
// Clear progress widget and status after task finishes
|
||||||
clearInterval(spinnerTimer);
|
clearInterval(spinnerTimer);
|
||||||
ctx.ui.setWidget("ralph-task", undefined);
|
ctx.ui.setWidget(widgetKey, undefined);
|
||||||
ctx.ui.setStatus("ralph", undefined);
|
ctx.ui.setStatus("ralph", undefined);
|
||||||
|
|
||||||
if (!output.success) {
|
if (!output.success) {
|
||||||
|
|||||||
@@ -90,7 +90,10 @@ function parseFioFormat(
|
|||||||
if (inDeps) {
|
if (inDeps) {
|
||||||
// Format 2: Arrow notation with multiple targets
|
// Format 2: Arrow notation with multiple targets
|
||||||
// "01 -> 02,03,06 (description)" means 02, 03, 06 depend on 01
|
// "01 -> 02,03,06 (description)" means 02, 03, 06 depend on 01
|
||||||
const arrowMatch = line.match(/^(\d+)\s*->\s*([\d,\s]+?)(?:\s*\(|$)/);
|
// Supports optional markdown list prefix: "- 01 -> 02,03,06"
|
||||||
|
const arrowMatch = line.match(
|
||||||
|
/^(?:\s*[-*]\s+)?(\d+)\s*->\s*([\d,\s]+?)(?:\s*\(|$)/,
|
||||||
|
);
|
||||||
if (arrowMatch) {
|
if (arrowMatch) {
|
||||||
const [, from, targets] = arrowMatch;
|
const [, from, targets] = arrowMatch;
|
||||||
const fromId = `0${from}`;
|
const fromId = `0${from}`;
|
||||||
@@ -108,7 +111,10 @@ function parseFioFormat(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Format 1: Natural language "X depends on A, B, C"
|
// Format 1: Natural language "X depends on A, B, C"
|
||||||
const dependsMatch = line.match(/^(\d+)\s+depends\s+on\s+([\d,\s]+)/i);
|
// Supports optional markdown list prefix: "- 13 depends on 17, 18, 19"
|
||||||
|
const dependsMatch = line.match(
|
||||||
|
/^(?:\s*[-*]\s+)?(\d+)\s+depends\s+on\s+([\d,\s]+)/i,
|
||||||
|
);
|
||||||
if (dependsMatch) {
|
if (dependsMatch) {
|
||||||
const [, taskId, depsList] = dependsMatch;
|
const [, taskId, depsList] = dependsMatch;
|
||||||
const taskIdPadded = `0${taskId}`;
|
const taskIdPadded = `0${taskId}`;
|
||||||
|
|||||||
Reference in New Issue
Block a user