Skip to content

Fix and review agents should check linked issue status before proceeding #1093

Description

@fullsend-ai-retro

What happened

PR #6710 was created by the code agent on Aug 27 to address issue #6707 (broken OpenShell 0.0.115 macOS binaries). The next day (Aug 28), the upstream fix shipped in v0.0.116 and issue #6707 was closed via a separate PR (#6737). Three days later (Aug 31), a human issued /fs-fix on the still-open PR, triggering 3 fix iterations (runs 33380188956, 33382017669) and 3 review cycles (runs 33378869752, 33380792281, 33382635493), costing ~$12. The review agent only detected the obsolescence on its 3rd pass by noticing the diff was a no-op against main — not by checking the linked issue's status.

What could go better

Neither the fix nor review agents checked whether the linked issue (#6707, referenced via Closes #6707) was still open before proceeding. If either agent had made a single GitHub API call to check the issue status, it would have discovered the issue was closed on Aug 28 and could have immediately recommended closing the PR — saving ~$12 across 5 wasted agent runs.

Existing issue #1647 proposes this exact check for the code agent, but is explicitly scoped to the code agent only. The fix and review agents follow different dispatch paths (triggered by review events and PR pushes, not by ready-to-code labels) and have separate definitions in the agents repo, so extending the check requires changes to those agents specifically.

Confidence: high. The linked issue closure was a clear, machine-readable signal available via the GitHub API. The fix is lightweight (one API call early in the agent run) and would have prevented all subsequent wasted work in this case.

Proposed change

Add a linked-issue status check as an early validation step in the fix and review agent definitions in fullsend-ai/agents:

  1. Review agent (agents/review.md or its review skill): Add an instruction to check the status of any issue linked via Closes #N in the PR body before performing the diff review. If the linked issue is closed, flag this as a high-severity finding: the PR may be obsolete if the issue was resolved via a different path. The agent should recommend verifying whether the PR is still needed.

  2. Fix agent (agents/fix.md or its implementation skill): Add an instruction to check linked issue status before making code changes. If the linked issue is closed, report this finding instead of proceeding with fixes, and recommend closing the PR if the issue was resolved elsewhere.

The check is a single gh api repos/{owner}/{repo}/issues/{number} --jq '.state' call, consistent with the mechanism proposed in #1647 for the code agent. Cross-reference #1647 so the implementations stay aligned.

Validation criteria

Over the next 10 fix or review agent runs on PRs whose linked issues are already closed, the agent should detect and report the closure in its first iteration rather than proceeding with substantive work. Specifically: the agent's output or review comment should mention the linked issue's closed status, and no unnecessary code changes or iterative reviews should follow.


Generated by retro agent from fullsend-ai/fullsend#6710

Activity

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

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions