openpencil/apps
Fini dafe5d105b fix(ai): roll back plan-seeded variables on abort/no-content path too
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.
2026-04-29 09:50:38 +08:00
..
cli chore(release): bump to v0.8.0 2026-04-27 08:20:00 +08:00
desktop chore(release): bump to v0.8.0 2026-04-27 08:20:00 +08:00
web fix(ai): roll back plan-seeded variables on abort/no-content path too 2026-04-29 09:50:38 +08:00