You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: ensure evaluator triggers when resuming multi-pass planning sessions (#571)
Fixed a critical bug where resuming an ultraplan session in multi-pass mode
would fail to trigger the plan evaluator. The issue occurred because:
1. The resume logic checked CoordinatorID (single-pass field) instead of
PlanCoordinatorIDs (multi-pass field)
2. When GetInstance returned nil for a planner, it wasn't marked as
processed, causing false negatives in the all-completed check
The fix:
- Added proper multi-pass handling in resumeMultiPassPlanning that checks
existing planners, collects completed plans, and triggers the evaluator
- Created multiPassResumeDeps struct for dependency injection to enable
comprehensive testing without real orchestrator/tmux
- Added 13 unit tests covering all code paths including edge cases
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [Unreleased]
9
9
10
+
### Fixed
11
+
12
+
-**Multi-Pass Planning Session Resume** - Fixed a critical bug where resuming an ultraplan session in multi-pass mode (`:ultraplan --multi-pass`) would fail to trigger the plan evaluator. When the TUI was closed while the 3 parallel planners were running, re-attaching to the session would incorrectly check `CoordinatorID` (which is not used in multi-pass mode) and restart planning from scratch, overwriting `PlanCoordinatorIDs` with new instance IDs. The original planners' completion events would then be orphaned, causing the evaluator to never kick off. The fix adds proper multi-pass handling in session resume: it now correctly checks for existing planners in `PlanCoordinatorIDs`, collects any completed plans from worktrees, and triggers the evaluator when all planners have finished. Also fixed an edge case where missing planner instances (GetInstance returning nil) would cause false negatives in the all-processed check, preventing the evaluator from being triggered.
13
+
10
14
### Changed
11
15
12
16
-**Instance Manager Callbacks Required at Construction** - Callbacks (OnStateChange, OnMetrics, OnTimeout, OnBell) are now passed via `ManagerCallbacks` struct in `ManagerOptions` at construction time, rather than being set separately via setter methods. This prevents the "leaky abstraction" bug where `Start()`/`Reconnect()` could be called without callbacks configured. The callback setter methods are now deprecated.
0 commit comments