Skip to content

Triage agent: flag issues that reference open PRs before auto-labeling ready-to-code #1650

Description

@fullsend-ai-retro

What happened

Issue #1639 was filed by ifireball as a follow-up from reviewing ADR 0041 on PR #1578. The issue body explicitly referenced PR #1578 as the source context. The triage agent labeled it ready-to-code within 5 minutes, the code agent created PR #1642, and the review agent approved it. 24 minutes later, the human closed both the issue and PR, applying the changes directly on PR #1578 instead. The full agent pipeline (triage + code + review) produced work that was discarded.

What could go better

The triage agent could detect when an issue body references an open PR (e.g., 'found during review on PR #1578') and flag this before auto-labeling ready-to-code. In such cases, the changes may belong on the referenced PR rather than a new one. This is a modest improvement — the waste here was small (doc-only changes, ~15 min pipeline), and it's hard to distinguish legitimate follow-up issues from ones the human intends to handle inline. Confidence: medium-low. This pattern may not be common enough to warrant added triage complexity. Existing issues #1647 (verify issue open), #576 (superseded close reason), and #1414 (companion PR detection) cover adjacent but distinct scenarios — none specifically address detecting open-PR references in issue body at triage time.

Proposed change

In the triage agent's instructions (agent definition or skill), add a heuristic: when the issue body contains references to open PRs (e.g., 'PR #NNN', 'pull/NNN'), the triage agent should check if those PRs are still open. If so, include a note in the triage comment suggesting the issue author consider whether changes should be applied directly to the referenced PR, and optionally use a label like needs-decision instead of ready-to-code to pause auto-coding. This should be a soft signal (comment note) rather than a hard gate, since many follow-up issues legitimately warrant separate PRs.

Validation criteria

Over the next 10 issues where the body references an open PR, the triage agent should include a note about the referenced PR in at least 80% of cases. Track whether any of those issues are subsequently closed as superseded — if the rate drops compared to the current baseline, the heuristic is adding value.


Generated by retro agent from #1642

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/triageTriage agentfeatureFeature-category issue awaiting human prioritizationpriority/lowNice to have, address when convenienttriagedTriaged but awaiting human prioritizationtype/featureNew capability request

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions