Skip to content

vteam ensure-merge

Move done tasks through review by checking their pull requests.

Terminal window
vteam ensure-merge

A coder task is done once its PR is open, but the PR still has to get through review. An agent that opens a PR without a task (like the test writer) gets a done task recording the PR, so every vteam PR is tracked. The merge ensurer checks every done task that has pr-url metadata and no merged=true metadata. It does not run Claude:

PR state What happens
merged Sets metadata merged=true. The task stays done and is not checked again
closed without merging Sets the task to canceled with a note. Canceled tasks stay in the dedup list, so the finding is not reported again
open, with the mergeEnsurer.label label Removes the label, moves the task to todo, clears retry-count, and adds a note. The coder then follows up on the PR
open, conflicting with its base branch Moves the task to todo with a note. The coder merges the base branch and resolves the conflicts
open, otherwise Nothing. Review comments alone never reopen a task; only the label you add does

The label is removed before the task is reopened. If that removal fails, the task stays done and the next run tries again. Removing it first means a label left behind can never reopen the task over and over. While GitHub or GitLab is still working out whether a PR is mergeable, conflicts are skipped until a later run.

It also marks interactive sessions whose window was closed without submitting as abandoned and returns their tasks to todo.

To run the ensurer on a schedule, enable its cron (vteam cron enable merge-ensurer, or the TUI). mergeEnsurer.cron is its default pattern. Each run writes a log to logs/merge-ensurer/ in the project’s state directory. A stop is checked between PRs.