After a PR merges, end its idle worker and finish the cleanup instead of skipping it

Open
#118 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
53/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
git, github, python
Domain
cli, devtools

Research direction

Start by tracing the board pass and the merged PR worker cleanup flow, including how the swarm MCP sends commands and checks whether a Claude worker is busy. Find the cleanup tests and add coverage for an idle worker, a busy worker retried on a later pass, and a dirty worktree reported once. Done when these cases pass across the supported repositories and boards.

Written by the indexing model from the issue text.

Description

Approved by Michal, 2026-11-17 11:17 AM ET: "file the cleanup fix as an approved ticket."

What happened

Methodology PR #111, the one-flow proposal, merged at 9:07 AM ET. Its worker reported done at 9:08 AM ET but never exited. The cleanup after the merge refused to remove the worktree because a live Claude was still running in it (pane %268). Nothing ever retried, so the window sat idle for about two hours until Michal noticed.

Rule (already in the methodology)

After a PR merges, clean up its worker: close the tmux window, remove the worktree if it's clean, and delete the local branch. Do this on every merge.

What to build

  1. When a PR has merged and its worker has reported done, or is idle at its prompt, the cleanup ends that Claude cleanly (an /exit sent through the swarm MCP), then closes the window, removes the worktree if it's clean, and deletes the local branch.
  2. If the Claude is still busy, the cleanup doesn't kill it. It retries later, for example on the next board pass, until the cleanup is done.
  3. If the worktree has uncommitted changes, keep the worktree and report that once. Don't retry forever silently.
  4. Works the same for every repo and board (platform, methodology, tangentswarm).

Done when

  • A test shows a merged PR whose worker is idle gets fully cleaned up without anyone asking.
  • A test shows a busy worker is left alone and cleaned up on a later pass.
Dominant language
Python
Stars
3
Forks
0
Avg merge
5h 57m
Merged PRs (30d)
60

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tangentcode/tangentswarm

All issues in tangentcode/tangentswarm

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.