Skip to content

Copilot SWE agent should auto-include 'Fixes #N' closing keyword in PR descriptions #12822

@clubanderson

Description

@clubanderson

Problem

When Copilot SWE agent is assigned to an issue and creates a PR, the PR description does not include GitHub closing keywords like Fixes #N, Closes #N, or Resolves #N. This means the original issue does not auto-close when the PR is merged, requiring manual cleanup.

Despite having the instruction in three separate places:

  1. .github/copilot-instructions.mdInclude Fixes #ISSUE_NUMBER in PR body
  2. Workflow comment instructions → Create a PR with Fixes #$ISSUE_NUM in the description
  3. Issue assignment comments → Same instruction

Copilot consistently ignores this instruction. Tested across 10+ PRs — none included closing keywords.

Expected Behavior

When Copilot creates a PR from an issue assignment, it should automatically include Fixes #<issue_number> in the PR description. The agent knows which issue it was assigned to — it should reference it with a closing keyword.

Current Workaround

We added a step in our copilot-automation.yml workflow that detects Copilot PRs missing closing keywords and auto-injects Fixes #N by:

  1. Querying GraphQL closingIssuesReferences
  2. Searching for open issues assigned to copilot-swe-agent[bot]
  3. Extracting #N references from the PR body

This works but is unnecessary complexity that should be handled natively by the agent.

Proposal

When copilot-swe-agent[bot] creates a PR from an issue assignment, automatically include Fixes #<issue_number> in the PR body. This is a standard GitHub convention that every human developer follows — the agent should too.

Impact

  • Every repo using Copilot SWE agent for automated issue fixing
  • Without this, issues accumulate as open even after their fix PRs are merged
  • Breaks CI/CD pipelines that rely on issue auto-close for state management

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions