Skip to content

Replace single combined summary field with separate issueSummary and prSummary fields - #25

Merged
richardthombs merged 2 commits into
mainfrom
copilot/fix-issue-pr-summary-duplication
Mar 19, 2026
Merged

richardthombs merged 2 commits into
mainfrom
copilot/fix-issue-pr-summary-duplication

Conversation

Copilot AI commented Mar 19, 2026 •

Copy link
Copy Markdown
Contributor

Issue and PR summaries were generated from a single AI-produced string split by paragraph count — giving the AI no structural incentive to keep content separate, and routinely producing duplicate information in both sections.

Changes

  • types.Review — Replace Summary string with IssueSummary and PRSummary fields; validation requires both to be non-empty
  • AI prompt (engine.go) — Schema now requests two distinct fields with explicit content constraints:
    • issueSummary: derived only from linked issues; must not reference the diff
    • prSummary: derived only from the PR diff/changed files; must not reference issues
  • render.go — renderMarkdown reads the fields directly; removes splitIssueAndPRSummaries and splitParagraphs
  • whatIfReview — Updated to populate both new fields
  • Tests — All test fixtures and JSON assertions updated to use issueSummary/prSummary
{
  "issueSummary": "...",
  "prSummary": "...",
  "risk": { ... },
  "findings": [ ... ],
  "checklist": [ ... ]
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/acme/repo/pulls/42
    • Triggering command: /usr/bin/gh gh api repos/acme/repo/pulls/42 --jq .base.ref,.base.sha (http block)
    • Triggering command: /usr/bin/gh gh api repos/acme/repo/pulls/42 --jq .base.ref,.base.sha 0.1-go1.25.0.lin--gdwarf-5 --global ux-amd64/pkg/tool/linux_amd64/cgo pull.rebase (http block)
    • Triggering command: /usr/bin/gh gh api repos/acme/repo/pulls/42 --jq .base.ref,.base.sha _.a pto/tls/alert.go ux-amd64/pkg/tool/linux_amd64/compile pull.rebase (http block)
  • https://api.github.com/repos/acme/repo/pulls/73
    • Triggering command: /usr/bin/gh gh api repos/acme/repo/pulls/73 --jq .base.ref,.base.sha (http block)
    • Triggering command: /usr/bin/gh gh api repos/acme/repo/pulls/73 --jq .base.ref,.base.sha _.a dor/golang.org/x/net/http/httpguts/guts.go ux-amd64/pkg/tool/linux_amd64/compile pull.rebase (http block)
    • Triggering command: /usr/bin/gh gh api repos/acme/repo/pulls/73 --jq .base.ref,.base.sha ux-amd64/src/net --local /usr/local/bin/bash pull.rebase 5519 (http block)
  • https://api.github.com/repos/acme/repo/pulls/77
    • Triggering command: /usr/bin/gh gh api repos/acme/repo/pulls/77 --jq .base.ref,.base.sha (http block)
    • Triggering command: /usr/bin/gh gh api repos/acme/repo/pulls/77 --jq .base.ref,.base.sha /addrselect.go /cgo_unix.go ux-amd64/pkg/tool/linux_amd64/compile pull.rebase (http block)
    • Triggering command: /usr/bin/gh gh api repos/acme/repo/pulls/77 --jq .base.ref,.base.sha ux-amd64/src/net-s DWaQSdYHv u/13/cc1 pull.rebase (http block)
  • https://api.github.com/repos/checkouttestuser/checkouttestrepo/pulls/987654321
    • Triggering command: /usr/bin/gh gh api repos/checkouttestuser/checkouttestrepo/pulls/987654321 --jq .base.ref,.base.sha (http block)
    • Triggering command: /usr/bin/gh gh api repos/checkouttestuser/checkouttestrepo/pulls/987654321 --jq .base.ref,.base.sha 0.1-go1.25.0.lin--gdwarf-5 0.1-go1.25.0.lin--64 rg/toolchain@v0.-o pull.rebase (http block)
    • Triggering command: /usr/bin/gh gh api repos/checkouttestuser/checkouttestrepo/pulls/987654321 --jq .base.ref,.base.sha ux-amd64/src/net-p --local ux-amd64/pkg/tool/linux_amd64/compile user.email (http block)
  • https://api.github.com/repos/checkouttestuser2/checkouttestrepo2/pulls/123456789
    • Triggering command: /usr/bin/gh gh api repos/checkouttestuser2/checkouttestrepo2/pulls/123456789 --jq .base.ref,.base.sha (http block)
    • Triggering command: /usr/bin/gh gh api repos/checkouttestuser2/checkouttestrepo2/pulls/123456789 --jq .base.ref,.base.sha 0.1-go1.25.0.lin-pthread 0.1-go1.25.0.lin-Wl,--no-gc-sections rg/toolchain@v0.-fmessage-length=0 pull.rebase (http block)
    • Triggering command: /usr/bin/gh gh api repos/checkouttestuser2/checkouttestrepo2/pulls/123456789 --jq .base.ref,.base.sha ux-amd64/src/net-p --local ux-amd64/pkg/tool/linux_amd64/link user.email (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Issue summary and PR summary often contain the exact same information</issue_title>
<issue_description># Problem statement
Issue summary and PR summary often contain the exact same information

Requirements

  1. The issue summary MUST be derived ONLY from information contained in the issues. It MUST NOT contain information from the PR.
  2. The PR summary MUST be derived ONYL from information contained in the PR - it MUST be a summary of what changes have been made. It MUST NOT contain information from the issues.

</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- Replace single `Summary` field with `IssueSummary` and `PRSummary` in types.Review
- Update AI prompt to request separate fields with explicit content constraints:
  issueSummary derived ONLY from linked issues
  prSummary derived ONLY from PR diff/changed files
- Remove splitIssueAndPRSummaries/splitParagraphs helpers from render.go
- Update renderMarkdown to use the new fields directly
- Update whatIfReview to set the new fields
- Update all tests to use the new field names and JSON keys

Co-authored-by: richardthombs <1511599+richardthombs@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue summary and PR summary duplication Replace single combined summary field with separate issueSummary and prSummary fields Mar 19, 2026
Copilot AI requested a review from richardthombs March 19, 2026 15:25
@richardthombs
richardthombs marked this pull request as ready for review March 19, 2026 16:10
@richardthombs
richardthombs merged commit f794e62 into main Mar 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue summary and PR summary often contain the exact same information

2 participants