Skip to content

[meta] Orchestrator: de-dup open PRs at planner dispatch #47

@OriginalGary

Description

@OriginalGary

Problem

The orchestrator dispatches planner for an issue without first checking whether an open PR already references that issue. This produces duplicate PR pairs targeting the same issue:

Issue PR A PR B
platform#114 platform#115 (older) platform#124 (closed as dup)
platform#87 platform#119 (older) platform#126 (closed as dup)
platform#90 platform#123 (broader) platform#104 (closed as dup)
platform#111 platform#112 (combined) platform#120 (closed as dup)

All four pairs surfaced in the 2026-04-26 complexity-cut review.

Proposed fix

Before dispatching planner for issue #N:

  1. Query gh pr list --repo <r> --state open --search "#N in:body,title" to detect any existing open PR that references the issue.
  2. If one exists:
    • Skip planner dispatch entirely, OR
    • Reroute to plan-reviewer with the existing PR as input (validate the in-flight plan instead of authoring a new one).
  3. Document the dispatch decision in the run report so duplicates can be audited downstream.

Stage label

stage:triaged — needs planner.

Source

Surfaced by manual complexity-cut review on 2026-04-26.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:goCleared for agent executionpriority:2Medium — next wavestage:ready-to-mergeAll gates passed — awaiting mergetype:bugBroken behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions