The previous rollback only fired in the catch block — but executeSubAgents can also resolve cleanly with zero content (sub-agent caught its own abort or returned empty), in which case the function falls through to Phase 4 without throwing. The existing line `if (generatedNodeCount === 0 && !aborted) throw …` deliberately swallows the empty-but-aborted case so Stop-clicks render as cancelled-not-errored — but it left doc.variables permanently mutated with the plan's palette. Now both branches of the `generatedNodeCount === 0` check run the same restore-from-snapshot logic before either throwing (non-aborted) or returning quietly (aborted). The catch-block rollback for hard failures stays as is. Updated the structural pattern test to allow the new rollback block (~900 chars of code+comment) to live between the zero-count check and the throw. |
||
|---|---|---|
| .. | ||
| public | ||
| server | ||
| src | ||
| CLAUDE.md | ||
| components.json | ||
| dev.ts | ||
| package.json | ||
| tsconfig.json | ||
| vite.config.ts | ||