Skip to content

CLI-119: lane next has three unhandled failure modes (start race, create-then-type stall, slug collision) #2576

Closed

Description

@mlorentedev

Found by the independent review of CLI-119-lane-next (FAIL at ff0b161, PR #2573). Three minors the fix PR dispositions as tickets, not fixes.

  1. Find -> Create race (cli/internal/lane/handoff.go). Two sessions started at once both see no worktree for the branch and both call Create. AC3 ("or from two sessions") is proven only sequentially. Fix options: serialise on the lease file / a lock under the git common dir, or treat a Create conflict as "already started" and re-Find. Add a parallel-run test. The atomic claim of CLI-128 (CLI-128: atomic lane claim on a git ref #2551) may subsume this.
  2. Create succeeds, Type fails. The branch is left with an open workspace and no agent; every later run answers "a workspace already shows ; no second agent started", so the queue stalls until a human closes it. Fix options: on a Type failure close the workspace this run opened (Backend has no remove today, by design), or let a re-run type again when the pane shows no agent.
  3. Slug collisions. Two issues whose titles slug alike, or a title with no [a-z0-9] word (slug "lane"), share one branch, so the second is never started: Find sees the first's worktree. Fix options: add the issue number to the branch name, or detect the collision in Next.

Root cause common to all three: the hand-off decides from a read (Find) and acts later, with the branch name as the only identity.

Activity

  1. mlorentedev commented on Oct 16, 2026

    @mlorentedev
    OwnerAuthor

    Round-2 review (PR #2586) adds a fourth item of the same class: excludeLease (cli/internal/lane/lease.go) is a read-modify-write append on the shared <git-common-dir>/info/exclude; two concurrent lane next runs can interleave and drop an append. Low impact (a re-run re-appends), and it can ride along with the Find->Create start race fix.

  2. self-assigned this
    on Oct 16, 2026
  3. mlorentedev commented on Oct 16, 2026

    @mlorentedev
    OwnerAuthor

    Picked up in autonomous pilot mode (run pilot-r4). Scope: points 2 (create-then-type stall) and 3 (slug collision); point 1 (find->create race) is left to the atomic claim of CLI-128 (#2551) unless a cheap re-Find on conflict suffices. Branch: fix/lane-next-failure-modes.

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

Metadata

Metadata

Assignees

Labels

debtKnown tech-debt paydown

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions