Skip to content

optimize pr-code-quality-reviewer: trim prompts to cut ~34–51 AIC/run - #48448

Merged
pelikhan merged 2 commits into
mainfrom
copilot/agentic-token-optimizer
Jul 28, 2026
Merged

optimize pr-code-quality-reviewer: trim prompts to cut ~34–51 AIC/run#48448
pelikhan merged 2 commits into
mainfrom
copilot/agentic-token-optimizer

Conversation

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

pr-code-quality-reviewer has 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-line If 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-coder rules 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.

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
Copilot AI requested a review from pelikhan July 27, 2026 21:15
@github-actions

Copy link
Copy Markdown
Contributor

🤖 PR Triage

Field Value
Category chore (optimization)
Risk 🟢 low
Score 38/100 (impact:18 urgency:10 quality:10)
Action ⏸️ defer

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.

Generated by 🔧 PR Triage Agent · sonnet46 · 63.9 AIC · ⌖ 5.94 AIC · ⊞ 5.7K ·

@pelikhan
pelikhan marked this pull request as ready for review July 28, 2026 01:30
Copilot AI review requested due to automatic review settings July 28, 2026 01:30
@pelikhan
pelikhan merged commit 9cfac22 into main Jul 28, 2026
@pelikhan
pelikhan deleted the copilot/agentic-token-optimizer branch July 28, 2026 01:30

Copilot AI 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

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"
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.83.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[agentic-token-optimizer] Optimize PR Code Quality Reviewer — AIC trending up 2.4× (66 → 160 avg/run)

3 participants