Skip to content

Spec Run keeps dispatching and Self-merging Tickets after its Spec PR is closed mid-run #1471

Closed

Description

@JacobStephens2

What happened

A pickup took tourbot#1027 at 11:54 EDT on 2026-10-27. branch::select found issue-1027 and its open Spec PR tourbot#1505 and chose a Continuation. Selection::pr_base then replaced the given Base branch master with the PR's base:

continuing issue-1027 and its PR .../pull/1505, so the Base branch is parent-engagement/browser-testing/staging, not the given master

At 12:00 EDT a human closed #1505 after reshaping #1027 to target master. The Ticket bodies were rewritten too: "Base branch: master… never merge issue-1027." The Run kept going:

  • 13:14: writing the Tickets checklist failed with PR .../pull/1505 is closed, not open. warn_checklist (src/pull_request.rs:156) logged this as a progress step, and the Run went on.
  • 13:14–13:32: it dispatched tourbot#1035 and tourbot#1037 from origin/issue-1027. It Self-merged their PRs (Drop the macOS release target and macOS CI jobs #1666, Specialize thirdshift on Linux and drop native macOS support #1665) into issue-1027 and closed both issues. That work went to a branch the Spec had just abandoned, and the Tickets were marked done.
  • 13:32: the Run ended "failed", with the closed PR as its cause. Its printed Recovery command resumes the old Base branch, so following it would repeat the mistake.

Command record: ~/.thirdshift/logs/Educational-Travel-Adventures/tourbot/commands/pickup/1027-20261027T115401-0400~bUnHddshqYWGtnwI.command.json

Expected

When the Spec PR is closed (or its base changes) mid-run, the Run should stop dispatching new Tickets and should not Self-merge any more Ticket PRs into the Spec branch. It should end with a cause that says the Spec was closed under it. It should not print a Recovery command that resumes the closed branch.

Proposal

  1. Before each Ticket dispatch, and again before each Ticket Self-merge, re-observe the Spec PR. If it is no longer open, or its base no longer matches the Base branch chosen at pickup, stop: give in-flight Tickets no new work and merge nothing more.
  2. Make a closed Spec PR a hard error in the checklist write, not a warn_checklist progress line. Other checklist write failures can stay warnings.
  3. When the Run ends this way, leave out the Recovery command, or have it start Fresh from the given Base branch.

Regression test

Use a fake GitHub whose Spec PR flips to closed after the first Ticket is dispatched. Assert that no later Ticket is dispatched, that no Ticket PR is merged after the flip, and that the cause names the closed Spec PR.

Activity

  1. added
    bug
    ready-for-agent
    in-progress
    and removed
    ready-for-agent
    on Oct 27, 2026
  2. added a commit that references this issue on Oct 27, 2026
  3. removed
    in-progress
    on Oct 27, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions