Skip to content

Lane-runner should check segment completion before spawning next iteration #508

Description

@HenryLach

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions