Skip to content

Planboard never moves an issue to Done: close it when the work lands #632

Closed

Description

@currentbits

The board only ever moves forward. Start task (App.tsx:867) and autodispatch (autodispatch.js:45) call issues.setPlanStatus(..., "doing"); nothing in the app ever calls it with "done". The done edge is delegated to whichever agent happens to be looking — and the agent that does the work (a worker in its own worktree) is never the one that lands it, so the label stays at plan:doing forever. Nine issues were sitting in Doing today with all their code on main.

postmerge.js already has the inverse edge (#420 reopens the issue when post-merge verification fails), which only makes sense if something closes it.

Fix

issues.completeIssue(projectPath, number, {comment}) — gh issue view --json state,labels, then plan:done + gh issue close. Gated on the issue actually carrying plan:doing, so a stray #N in a prompt cannot close an issue nobody started. Already-closed is success.

postmerge.completeThreadIssue(store, threadId) resolves the thread's issue (thread.issueNumber → strict GitHub issue #N: prompt → loose issue #N in the first user message only) and fires it, once per issue per process.

Called fire-and-forget from the two places work actually lands:

  • worktrees.mergeWorktree after a successful squash (the Git tab and thread_merge)
  • postmerge.onThreadPrState on MERGED (interactive prStatus + the background PR refresher)

Leaves an event line on the thread: Planboard: #N moved to Done.

Not covered

An issue an agent flipped to plan:doing by hand for a thread whose work is landed outside the app (git merge in a terminal) still needs a human. A stale-Doing sweep would be a separate issue.

Activity

  1. added and removed on Aug 22, 2026
  2. currentbits commented on Aug 22, 2026

    @currentbits
    OwnerAuthor

    Landed on main (bf7c4dc): issues.completeIssue (electron/issues.js:464), postmerge.completeThreadIssue (electron/postmerge.js:226), wired fire-and-forget from electron/worktrees.js:705 and postmerge.js:200, with tests in electron/test/postmerge.test.js:464. Closing by hand because the issue predates its own fix.

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

    bugSomething isn't workingplan:donePlanboard status

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions