Problem
After a segment-scoped worker completes all its checkboxes and exits with a text summary, the exit interception correctly allows it to close. But the lane-runner then spawns iteration 2 which immediately finds everything done and exits. This wastes one iteration (~30-60s + token cost) per segment.
Root Cause
The lane-runner checks .DONE and step completion AFTER spawning the worker. It does not check segment checkbox completion between iterations. So even when all segment checkboxes are checked, it spawns a new worker that has nothing to do.
Fix
Before spawning a new iteration, check if the current segment's checkboxes are all complete (using isSegmentComplete). If so, skip the iteration and proceed to segment completion handling.
Impact
Low — tasks complete correctly, just one wasted iteration per segment. But in a batch with many segments this adds up.
Files
extensions/taskplane/lane-runner.ts — iteration loop, pre-spawn check
Problem
After a segment-scoped worker completes all its checkboxes and exits with a text summary, the exit interception correctly allows it to close. But the lane-runner then spawns iteration 2 which immediately finds everything done and exits. This wastes one iteration (~30-60s + token cost) per segment.
Root Cause
The lane-runner checks
.DONEand step completion AFTER spawning the worker. It does not check segment checkbox completion between iterations. So even when all segment checkboxes are checked, it spawns a new worker that has nothing to do.Fix
Before spawning a new iteration, check if the current segment's checkboxes are all complete (using
isSegmentComplete). If so, skip the iteration and proceed to segment completion handling.Impact
Low — tasks complete correctly, just one wasted iteration per segment. But in a batch with many segments this adds up.
Files
extensions/taskplane/lane-runner.ts— iteration loop, pre-spawn check