Skip to content

fix(work-resolve-issue): stop a run when a listed human opens a PR for the issue mid-run #16748

Closed

Description

@kyle-sexton

Problem

A dispatched work-resolve-issue run keeps building and opens its pull request even when a listed human opens a draft pull request naming the same issue (Closes #N or Refs: #N) while the run is in progress. On #16646 this produced duplicate work twice in one night (lane PRs #16687 and #16722 against a local session's branch).

Cause

The checks that honour a human's open pull request run only before the run starts:

  • .github/scripts/intake-triage/admit.mjs openPullsNaming, at admission;
  • .github/scripts/work-unblock/label-unblocked.mjs humanPull, when work-unblock re-fires a run.

The only in-run re-check, .github/scripts/work-resolve-issue/check-blockers.mjs with RECHECK=true, reads the issue's blocker dependencies, not open pull requests.

Fix

Before the lane pushes its branch and opens its pull request, read the open pull requests naming the issue (reuse openPullsNaming or humanPull) and stop the run without pushing when a listed human's pull request is open, routing it like the admission-time hold.

Acceptance

  • A run whose issue gains a listed human's open (draft or ready) pull request naming it before the lane's push stops without pushing or opening a pull request.
  • A test covers the check with a human pull request present and absent.

Activity

  1. added
    needs-triage
    on Nov 17, 2026
  2. github-actions commented on Nov 17, 2026

    @github-actions
    Contributor

    Size: Medium
    Complexity: Medium
    Uncertainty: Known
    Flags: none
    Blocked by: none
    Blast radius: the work-resolve-issue write path (a new pre-push script step, the workflow step wiring, a shared helper in intake-triage/admit.mjs and its tests); read and run by the issue lane.
    Reversible: yes; revert the change and the lane returns to checking human pull requests only at admission.
    Open questions: none

    Understood: a dispatched run should re-check, before it pushes, whether a listed human has opened a draft or ready pull request naming the issue, and stop without pushing or opening a pull request if so.

    Decision recorded by the owner's batch answer:

    Decision recorded. The acceptance checklist below adopts intake's recommended answers to the refinement's three questions, under the owner's answer to the batch question for issues with only implementation questions.

    Owner's answer, 2026-11-17, typed in an agent session, verbatim: "Go with recommendations."

    [quote truncated; the full decision is at the link]

    #16748 (comment)

    This settles the open questions: the check runs after the build and before the push, the stop reuses the deferred or blocked-by-pr route, and one shared helper is built on openPullsFor. The pre-push steps live under .github/workflows/, so the issue keeps its host-run routing. No duplicate or merged fix found among the listed open issues and pull requests.

    Automated triage. A maintainer reviews it.

  3. removed
    needs-triage
    on Nov 17, 2026
  4. melodic-automation-lanes commented on Nov 17, 2026

    @melodic-automation-lanes
    Contributor

    Not admitted to the issue lane: it carries host-run. Admission takes the issue once each of those is met, when intake triages it again (.github/actions/resolve-config/admission-rules.json).

  5. melodic-automation-lanes commented on Nov 17, 2026

    @melodic-automation-lanes
    Contributor

    Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.

    Intended outcome: Before the lane pushes its branch, a run re-reads the issue's open pull requests and stops without pushing or opening a pull request when a listed human's draft or ready pull request names the issue; a test covers both cases.

    Open questions

    1. Where does the lane push its branch and open its pull request, and so where does the new check run? I found no push step in work-resolve-issue.yml or pr-run-activity-read.yml, so the push seems to happen inside the model job and a script step may have nothing to gate.
      RECOMMENDED: Add a no-model script step in .github/scripts/work-resolve-issue/ that runs after the build and before the push or PR step, and sets a stop output so the push is skipped. If the agent itself pushes, put the check in the step that precedes it. Basis: judgment: no push match in .github/workflows/work-resolve-issue.yml; .github/workflows/pr-run-activity-read.yml:688-705 shows the only in-run check is check-blockers RECHECK
    2. How should the stop be routed, given the issue says 'like the admission-time hold'? Admission defers the issue with a wait comment; an in-run stop could instead use a route from stop-routes.json.
      RECOMMENDED: Reuse the existing deferred or blocked-by-pr route so the issue keeps agent-ready, work-unblock re-fires it once the human pull request closes, and the comment names the pull request. Basis: .github/scripts/work-unblock/label-unblocked.mjs:1179-1183 and .github/scripts/work-resolve-issue/stop-routes.json
    3. Which helper does the check reuse? humanPull is private to label-unblocked.mjs, while openPullsFor in admit.mjs is exported but does not filter by listed human.
      RECOMMENDED: Call openPullsFor from admit.mjs, then read each pull and keep it when state is open and its user id is in the trusted humans list, as humanPull does; export a shared helper rather than copying. Basis: .github/scripts/work-unblock/label-unblocked.mjs:2198-2206 and .github/scripts/intake-triage/admit.mjs:492-500

    Sources read

    • .github/scripts/intake-triage/admit.mjs:380-387: openPullsNaming returns open pull numbers that close the issue or name it by a Refs line
    • .github/scripts/intake-triage/admit.mjs:492-500: openPullsFor reads the timeline and closing pulls fresh
    • .github/scripts/work-unblock/label-unblocked.mjs:2198-2206: humanPull keeps an open pull whose author is a listed human
    • .github/scripts/work-resolve-issue/check-blockers.mjs:117-122: RECHECK reads only blocked_by, not pull requests
    • .github/scripts/intake-triage/admit.test.mjs:659-673: existing tests for openPullsNaming
    • .github/scripts/work-unblock/label-unblocked.test.mjs:5053-5057: existing human pull test fixtures

    To answer, post a comment that starts with this line:

    **Decision recorded.** <answer>
    

    Automated refinement by the lanes App. Answer with a comment whose first line is **Decision recorded.**.

  6. kyle-sexton commented on Nov 17, 2026

    @kyle-sexton
    MemberAuthor

    Decision recorded. The acceptance checklist below adopts intake's recommended answers to the refinement's three questions, under the owner's answer to the batch question for issues with only implementation questions.

    Question as put to the owner (Q42, covering #15499, #16352, #16353, #16524, #16579 and #16748): six issues with only implementation questions.

    • A (recommended, chosen): an agent session posts a **Decision recorded.** comment on each, adopting triage's own answers as the acceptance checklist, so admission takes them.
    • B: the owner reviews each first.

    Owner's answer, 2026-11-17, typed in an agent session, verbatim: "Go with recommendations."

    The owner approved this agent session posting triage's answers as the checklist; he did not answer each implementation question himself. Triage found no open questions (triage). The answers adopted are the RECOMMENDED lines of the refinement:

    1. The check runs in the write path after the build and before the push: a no-model script step under .github/scripts/work-resolve-issue/ that sets a stop output so the push is skipped (or, if the agent itself pushes, the check sits in the step before it).
    2. The stop reuses the existing deferred or blocked-by-pr route, so the issue keeps agent-ready, work-unblock re-fires it once the human pull request closes, and the comment names that pull request.
    3. One exported shared helper calls openPullsFor from admit.mjs and keeps only open pull requests whose author is a listed human, as humanPull does, instead of copying either.

    This is host work: the write job's pre-push steps are in .github/workflows/, a path the issue lane refuses.

    Acceptance criteria

    • A shared helper, exported once, returns the open (draft or ready) pull requests that name the issue (Closes #N or Refs: #N) and whose author is a listed human, built on openPullsFor from .github/scripts/intake-triage/admit.mjs with the listed-human filter humanPull applies, and the new check calls it rather than copying either.
    • A work-resolve-issue run whose issue gains such a pull request before the lane's push stops without pushing or opening a pull request.
    • The stop takes the existing deferred or blocked-by-pr route, and its comment names the human's pull request.
    • A test covers the check with a listed human's pull request present and absent, and one with only a non-listed author's pull request.

    Posted by an agent session.

  7. added
    host-run
    on Nov 17, 2026
  8. github-actions commented on Nov 17, 2026

    @github-actions
    Contributor

    A listed human released the issue's Work status hold, so it goes back to intake triage.

  9. added a commit that references this issue on Nov 18, 2026
    047492e
  10. removed
    host-run
    on Nov 18, 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

    No labels
    No labels

    Type

    Fields

    Work status

    confirmed

    Priority

    medium

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions