optimize pr-code-quality-reviewer: trim prompts to cut ~34–51 AIC/run - #48448
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Optimize PR Code Quality Reviewer for better performance
optimize pr-code-quality-reviewer: trim prompts to cut ~34–51 AIC/run
Jul 27, 2026
Contributor
🤖 PR Triage
Trims pr-code-quality-reviewer prompts to save ~34–51 AIC/run. Small change (6 adds, 34 dels, 3 files). DRAFT. Valid cost optimization — defer until undrafted.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Reduces PR reviewer prompt and tool-call overhead.
Changes:
- Conditionally reads review memory.
- Condenses review formatting and sub-agent instructions.
- Regenerates workflow metadata.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/pr-code-quality-reviewer.md |
Streamlines reviewer prompts. |
.github/workflows/pr-code-quality-reviewer.lock.yml |
Updates generated body hash. |
.github/workflows/smoke-copilot-auto.lock.yml |
Removes unrelated model pricing metadata. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Medium
| - `/tmp/gh-aw/agent/pr-review-comments.json` — existing review comments (use to avoid duplication; each entry has `id`, `path`, `line`, `body`, `user`) | ||
| - (Optional) `/tmp/gh-aw/cache-memory/pr-${{ github.event.issue.number || github.event.pull_request.number }}.json` for past review themes | ||
|
|
||
| If this PR has been reviewed before, also read `/tmp/gh-aw/cache-memory/pr-${{ github.event.issue.number || github.event.pull_request.number }}.json` before Step 2 to inform theme continuity; otherwise skip. |
| @@ -149,7 +149,6 @@ jobs: | |||
| GH_AW_INFO_FIREWALL_TYPE: "squid" | |||
| GH_AW_INFO_FRONTMATTER_EMOJI: "🌸" | |||
| GH_AW_COMPILED_STRICT: "true" | |||
Contributor
|
🎉 This pull request is included in a new release. Release: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pr-code-quality-reviewerhas trended from 66 → 160 avg AIC/run (+2.4×) over 7 days. The growth is largely attributable to prompt bloat — redundant instructions, an always-attempted optional tool call, and a verbose worked example loaded on every run.Changes
Remove duplicate field-validation from
grumpy-coder— the 4-lineIf any field is malformed…block in the sub-agent is redundant; Step 3 in the main agent already discards malformed JSONL. Removed from sub-agent only.Decouple cache-memory read from the mandatory parallel turn — the
(Optional)cache file was the 4th item in the Step 1 parallel batch, so the agent always paid the tool-call overhead for a file that's empty on first review. Now conditional: read only if the PR has been reviewed before.Slim
grumpy-coderrules 5 → 3 — dropped "No compliments" (implied by grumpy persona) and merged "Be very critical and risk-focused" into the priority bullet.Replace 14-line worked Markdown/Go example in Step 4 with a one-sentence format spec — modern Haiku/Sonnet doesn't need a full worked example to follow a comment structure. The surrounding format bullet list (which duplicated the spec) was collapsed into the same sentence.