Repository navigation
1.2.0 (2026-11-24)
Patchmill 1.2 adds patchmill run, a runner that works through your issues on its own. Start it once, under systemd or in a terminal, and it triages new issues, resumes work in progress, and takes the next ready issue, one at a time, until you stop it. It works in label mode and in local state mode, and it needs no control plane.
The runner also keeps your open pull requests mergeable. When one Patchmill pull request merges and another one now conflicts with the base branch, the next pass fixes that conflict before it starts new work. An agent merges the base branch into the issue branch, and Patchmill checks the result before the issue goes back to Done.
The rest of the release makes runs harder to break. Agent commands can no longer hang a run forever, provider errors show up instead of leaving an agent silent, and a worker that forgets its result block or ends before its subagents no longer loses its work.
Read the upgrade notes at the end. Patchmill now needs Node 24 and Git 2.38 or later, and Ctrl-C during run-once now pauses the run instead of publishing Needs Info.
patchmill run: the unattended runner
patchmill run repeats one cycle until it gets SIGINT or SIGTERM. (#403)
- Triage, then one pass. Each cycle runs triage when
run.triageIntervalMinutes(default 5) has passed, and then one pass of work. A pass is the same aspatchmill run-oncewithout--issue: it cleans up merged issues, resolves a merge conflict, resumes in-progress work, and selects the next eligible issue. - It waits when there is nothing to do. When no issue is eligible, a planning gate waits for a merge, or another clone holds the issue, the runner waits and tries again. Waits double up to a cap, with jitter. Errors use a separate, longer backoff. A pass that does work resets both. Set the limits with
run.idleBackoffandrun.errorBackoff. - It doesn't empty your queue on a broken setup. From the third Needs Info stop in a row, each later stop waits for the error backoff. So a broken provider or Pi installation can't move every ready issue to
needs-infoat once. - A gate wait comments once. A planning gate that is still waiting for a merge no longer posts the same comment on every pass.
- One runner per clone. The runner holds a lock at
<git common dir>/patchmill/run.lock, shared by all worktrees of the clone. A second runner exits with code 2 and names the owner. The lock is freed when the runner exits, also after a crash. On the next start, Patchmill replaces a stale record only when its PID is gone or now belongs to another process on the same host. - A clean stop. The first signal stops the loop and pauses the active run: no comment, no label change, and the issue stays
in-progress, so the next start resumes it. A second signal forces an exit. Exit codes are 0 for a clean stop, 1 for an error, and 2 when another runner holds the lock.
The new Run unattended page in the docs has a systemd unit that you can copy, and it explains the log lines, which start with patchmill run:.
Merge conflicts resolve themselves
Before a pass selects new work, it now checks each Done issue that has an open Patchmill implementation pull request. (#416)
- The same check on every host. Patchmill runs
git merge-tree --write-treeon the fetched branches, so GitHub, Forgejo, and Gitea all give the same answer. Planning pull requests are not checked. - A merge, never a rebase. The oldest conflicting issue goes first. Its status changes to In Progress, and an agent session merges the base branch into the issue branch and pushes. It never rebases and never force-pushes, so reviewers keep their history and comments.
- Patchmill checks the agent's work. After the push, the branch must merge cleanly, and it must still contain its previous head and the base commit. Then the issue goes back to Done. If the agent can't resolve the conflict, or a check fails, the issue stops with Needs Info and a comment that names the files.
- No retry loops. Patchmill doesn't try a pull request again while its head and the base stay the same. A new attempt also waits at least
run.conflictRetryMinutes(default 30) after the last one. If another run holds the issue, the pass skips it and takes other work. - Other sessions merge first. Any implementation session on a conflicting pull request is told to merge the base first and then continue with its normal work.
This runs in every unattended pass, so patchmill run-once without --issue gets it too. patchmill doctor has a new git check for the Git 2.38 requirement.
Runs that don't get stuck
- Agent commands time out. Each agent
bashcall in an Issue run now has a default timeout of 20 minutes and a cap of 25. When the time runs out, Pi kills the command's process group, and the agent getsCommand timed out after N secondsand continues. This also applies to subagents at any depth. Change the limits withpi.commandTimeoutMinutesandpi.maxCommandTimeoutMinutes, or set either one to0to turn it off. (#422) - Provider failures are visible. When the model provider refuses a request, for example because of an expired token or an overload, Patchmill now says so. The Web session chat and the issue history show an error entry, the run stops with a clear reason, and triage logs a warning. For a sign-in failure, the message tells you to run
patchmill authand try again. The provider's own message never goes into an issue comment. It appears only in local output and the phase log. (#421) - A missing result block doesn't waste the work. When a worker ends without its final result block, Patchmill now reads the block from the worker's last message, then sends one reminder in the same conversation. If the block is still missing, an open, ready pull request that closes the issue counts as done. Before, all of these runs stopped as
no result. (#413) - Workers wait for their subagents. A worker now waits in the same turn for the subagent runs that it started, such as its reviewer. The Console agent never tells it to stop early. When a run still ends with
no result, the reason names the subagent run that was still running. (#411) - An abnormal Pi exit fails the phase. A
doneresult no longer counts when Pi then exits with a non-zero code or a signal. The phase stops with Needs Info and says how Pi exited. (#408)
Console, review, and hosts
- The console says what to do next. The status bar keeps the issue and its state visible for the whole Interactive Issue run and after it. During the review wait, the first message names the pull request and explains who merges it, what Patchmill does after the merge, and how to ask for changes or stop. When the run ends, the console reports the outcome, the cleanup, and the next step. After a failed or stopped run, the Console agent explains the problem. (#414)
- The reviewer can run validation commands. The managed
revieweragent now follows the review brief in its task and may run validation commands, such as the test suite.patchmill doctornow fails when the reviewer is missing, stale, disabled, shadowed by another definition, or has the wrong tools.patchmill doctor --fixrewrites onlyagents/reviewer.md. (#418) - GitHub App installation tokens work.
triage,run, andlabels setupno longer stop at startup with an App token. Whengh api useris refused, Patchmill checksgh api installation/repositoriesinstead. Trust then comes only fromhost.loginandhost.trustedAuthors. (#419)
Upgrade notes
- Node 24 or later is required. (#400)
- Git 2.38 or later is required for the merge-conflict check.
patchmill doctorreports an older Git. The Nix package now puts its own Git first onPATHfor Patchmill and all its child processes. A system credential helper that is set by a short name, such aslibsecret, is then no longer found. Use its full path. (#416) - Ctrl-C during
run-oncepauses the run.SIGINTorSIGTERMno longer publishesneeds-info. The issue staysin-progress, and the next run resumes it. A signal before the claim exits with code 0. (#403) - Unattended runs push to open pull requests. They can move a Done issue back to In Progress and push a merge commit to its branch without asking. They never force-push. (#416)
- Merged-issue cleanup now reports
cleanedwhen nothing was left to remove. (#400) - Configuration and saved state from 1.1 work as they are. All new settings are optional.
Dependencies
- Pi runtime packages are now 1.6.0. (#399)