Skip to content

Optimize PR Code Quality Reviewer prompt and diff prefetch - #51170

Merged
pelikhan merged 3 commits into
mainfrom
copilot/agentic-token-optimizer-optimize-pr-code-quality
Aug 7, 2026
Merged

Optimize PR Code Quality Reviewer prompt and diff prefetch#51170
pelikhan merged 3 commits into
mainfrom
copilot/agentic-token-optimizer-optimize-pr-code-quality

Conversation

CopilotAI commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

The PR Code Quality Reviewer carried duplicated prompt guidance and over-prefetched large PR diffs, increasing AIC on every run and especially on large diffs. This update trims always-loaded instructions and lowers the shared reviewer diff cap.

  • Prompt consolidation

    • Keeps progressive-disclosure formatting guidance at the point where review comments are written.
    • Removes the redundant Review Formatting subsection.
    • Folds “no empty compliments / no generic looks good” into the existing Do not flag list.
  • Diff cap reduction

    • Lowers shared PR diff prefetching from 3000 to 2000 lines in shared/pr-diff-data-fetch.md.
    • Recompiles all workflows that consume the shared import.
  • Engine alignment

    • Switches PR Code Quality Reviewer to the requested pi agentic engine.
engine:
id: pi

CopilotAIand others added 2 commits August 7, 2026 19:39
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
CopilotAI changed the title [WIP] Optimize PR Code Quality Reviewer by consolidating guidanceOptimize PR Code Quality Reviewer prompt and diff prefetchAug 7, 2026
CopilotAI requested a review from pelikhanAugust 7, 2026 19:50
@pelikhan
pelikhan marked this pull request as ready for review August 7, 2026 19:50
CopilotAI balanced review requested due to automatic review settings August 7, 2026 19:50
@pelikhan
pelikhan merged commit a03acf3 into mainAug 7, 2026
@pelikhan
pelikhan deleted the copilot/agentic-token-optimizer-optimize-pr-code-quality branch August 7, 2026 19:51

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Optimizes PR review token usage and aligns the code-quality reviewer with the Pi engine.

Changes:

  • Consolidates review-formatting guidance.
  • Reduces the intended diff cap from 3,000 to 2,000 lines.
  • Migrates the reviewer from Copilot to Pi.
Show a summary per file
FileDescription
.github/workflows/shared/pr-diff-data-fetch.mdLowers the shared diff cap.
.github/workflows/pr-code-quality-reviewer.mdStreamlines prompts and selects Pi.
.github/workflows/pr-code-quality-reviewer.lock.ymlRecompiles the reviewer for Pi.
.github/workflows/mattpocock-skills-reviewer.lock.ymlRecompiles with the lower cap.
.github/workflows/impeccable-skills-reviewer.lock.ymlRecompiles with the lower cap.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Balanced

PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
EXPR_GITHUB_REPOSITORY: ${{ github.repository }}
PR_DIFF_MAX_LINES: "3000"
PR_DIFF_MAX_LINES: "2000"
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.86.1

Sign up for freeto 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.

[agentic-token-optimizer] Optimize PR Code Quality Reviewer: consolidate duplicated prompt guidance and tighten diff cap

3 participants

@pelikhan