diff --git a/AGENTS.md b/AGENTS.md index babcac1..dd9f056 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -26,7 +26,7 @@ The only real npm dependency is `yaml` (^2.4.0). ## Source structure -- `index.ts` — extension entry, command routing, UI registration +- `index.ts` — extension entry, command routing, UI registration, reload detection - `src/` — all logic modules: - `parser.ts` — task file parsing (Fio, checkbox, YAML formats) - `dag.ts` — Kahn's algorithm dependency resolution, batch planning @@ -37,12 +37,13 @@ The only real npm dependency is `yaml` (^2.4.0). - `utils.ts` — config loading, progress discovery, `runAgentSession()` - `types.ts` — all interfaces and `DEFAULT_CONFIG` - `widget-batcher.ts` — debounced widget updates for parallel tasks + - `constants.ts` — static constants - `skills/ralpi-use.md` — Pi skill definition for task execution -- `tasks/` — example ralpi task files (self-modification history) +- `prompts/task-manager.md` — Pi prompt for task planning ## Runtime state -All runtime state lives in `.ralpi/` (gitignored): +All runtime state lives in `.ralpi/` in the **project directory** (not this extension directory): - `.ralpi/progress.json` — execution progress, supports multiple PRDs - `.ralpi/reflections/` — per-task reflection JSON files - `.ralpi/prompts/` — generated prompts (timestamped, for debugging) diff --git a/index.ts b/index.ts index da41449..bf9babd 100644 --- a/index.ts +++ b/index.ts @@ -202,18 +202,15 @@ async function executePlanBatches( failedTaskIds, ); - // Replace remaining batches with filtered ones - const currentIdx = plan.batches.indexOf(batch); - const remainingBatches = newPlan.batches.filter( - (b) => b.batchIndex > currentIdx, - ); + // Keep processed batches (up to current batch), replace the rest + // with the fresh plan — its batchIndex restarts at 0, so filtering + // by batchIndex > currentIdx would incorrectly drop the next batch. + const processedCount = plan.batches.indexOf(batch) + 1; + plan.batches.length = processedCount; + plan.batches.push(...newPlan.batches); - // Update the plan's batches in-place - plan.batches.length = 0; - plan.batches.push(...remainingBatches); - - // Skip empty batches - if (remainingBatches.length === 0) { + // Skip if nothing remaining + if (plan.batches.length === processedCount) { break; } } diff --git a/src/executor.ts b/src/executor.ts index f780db4..2697e28 100644 --- a/src/executor.ts +++ b/src/executor.ts @@ -500,7 +500,9 @@ async function executeBatchParallel( truncateToWidth(`${frame} ${entry.taskHeader}`, effectiveWidth), ); - if (entry.toolCalls.length > 0) { + // Only show tool calls for in-progress tasks; completed/failed + // tasks already have their tool-call tree in the chat history message. + if (!entry.done && entry.toolCalls.length > 0) { if (entry.toolCalls.length <= MAX_COLLAPSED) { for (let i = 0; i < entry.toolCalls.length; i++) { const tc = entry.toolCalls[i];