contribution-check: offload report formatting and comment routing to small-model sub-agents#33655
Merged
pelikhan merged 3 commits intoMay 21, 2026
Conversation
…her sub-agents Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…ay reference Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Optimize contribution-check workflow for performance
contribution-check: offload report formatting and comment routing to small-model sub-agents
May 21, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the Contribution Check orchestrator prompt to offload report formatting and PR comment payload routing into two inline model: small sub-agents, reducing prompt bloat and templated logic in the main orchestrator.
Changes:
- Replaced the inline “Posting comments” logic with a
comment-dispatchersub-agent invocation that returns[{issue_number, body}]. - Replaced the large static report layout rules/example with a
report-formattersub-agent invocation that generates the report issue markdown body. - Regenerated the compiled workflow lock file (compiler v0.74.8), including updated setup action wiring and environment propagation for
github.server_url/github.run_id.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/contribution-check.md | Moves report formatting and comment routing into two inline small-model agents and updates Step 1/2 instructions to call them. |
| .github/workflows/contribution-check.lock.yml | Regenerated compiled workflow/lock output reflecting the updated prompt and compiler/runtime wiring. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 4
Comment on lines
+230
to
+231
| You receive a JSON array of PR verdict objects (each with fields: `number`, `title`, `author`, `lines`, `quality`, `comment`) plus a `skipped_count` integer and a `run_url` string. | ||
|
|
Comment on lines
+234
to
+235
| 1. **Lead with the takeaway.** Open with a single-sentence human-readable summary: *"We looked at {evaluated} new PRs — {n} look great, {n} need a closer look, and {n} don't fit the project guidelines."* | ||
|
|
| - **Ready to review** 🟢 — PRs where `quality == "lgtm"` | ||
| - **Needs a closer look** 🟡 — PRs where `quality == "needs-work"` | ||
| - **Off-guidelines** 🔴 — PRs where `quality == "spam"` or `quality == "outdated"` | ||
| - **Triage needed** ❓ — PRs where `quality` starts with `"triage"` or is unknown |
| - **Off-guidelines** 🔴 — PRs where `quality == "spam"` or `quality == "outdated"` | ||
| - **Triage needed** ❓ — PRs where `quality` starts with `"triage"` or is unknown | ||
|
|
||
| 3. **One table per group.** Columns: PR (linked as `#number`), Title (truncated to ~50 chars), Author (with `@`), Lines changed, Quality signal. Do NOT include boolean checklist columns. |
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.
The contribution-check orchestrator carried ~70 lines of static report layout rules + a full example report in its context every run, plus ~14 lines of comment routing logic — all templated work well-suited to a cheaper model.
Changes
### Report Layout Rulesand### Example Reportsubsections (~70 lines) from## Step 2: Compile Report; replaced with a one-linereport-formatteragent invocation that passes the verdict array,skipped_count, and an explicitrun_url(${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})### Posting commentsblock (with examples/caveats) with a one-linecomment-dispatcheragent invocation; clarified that the input is the JSON objects returned by thecontribution-checkersubagent in Step 1## agent:blocks at the bottom of the file (after{{#runtime-import shared/noop-reminder.md}}):Both sub-agents use
model: small. They are orthogonal to the existing file-basedcontribution-checkerdelegate and can run concurrently once subagent results land. Compiled clean withgh aw compile --strict(0 errors, 0 warnings).