Fix agentic triage comment submission and reject incomplete summaries - #4706
Open
priyankatiwari08 wants to merge 1 commit into
Open
priyankatiwari08 wants to merge 1 commit into
priyankatiwari08 wants to merge 1 commit into
Conversation
Allow jq payload preparation, document one-shot JSON submission, and validate triage summaries before safe-output writes. Preserve comment limits, label restrictions, and incomplete-result reporting. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
priyankatiwari08
requested review from
a team
and
a balanced review from Copilot
September 17, 2026 10:47
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The validator still accepts collector errors, embedded placeholders, and contradictory no-op/incomplete batches.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Repairs issue-triage safe-output submission and adds pre-publication validation.
Changes:
- Enables safe JSON payload creation with
jq. - Validates triage summaries before publishing comments or labels.
- Adds regression tests and regenerates the workflow lock.
File summaries
| File | Description |
|---|---|
.github/workflows/verify-aw-lock.yml |
Runs validator tests during lock verification. |
.github/workflows/issue-triage.md |
Adds safe submission guidance and validation steps. |
.github/workflows/issue-triage.lock.yml |
Regenerates the executable workflow. |
.github/scripts/validate-triage-output.cjs |
Implements output validation. |
.github/scripts/tests/validate-triage-output.test.cjs |
Adds validator regression coverage. |
.github/scripts/tests/README.md |
Documents test execution and scope. |
Review details
Suppressed comments (2)
.github/scripts/validate-triage-output.cjs:36
- The validator ignores the collector's top-level
errorsarray. gh-aw records rejected/over-quota safe-output calls there while retaining any valid items, so a valid-looking comment plus a failed label or second submission is currently published as success. Reject any non-emptyoutput.errorsbefore processing items, and cover that mixed batch in the regression tests.
function validateTriageOutput(output) {
if (!output || !Array.isArray(output.items) || output.items.length === 0 ||
output.items.some(item => !item || typeof item.type !== 'string')) {
throw new Error('Missing or malformed triage output: expected non-empty result items.');
.github/scripts/validate-triage-output.cjs:50
- A batch containing both
noopandreport_incompletehas no comment, enters this branch, and returns successfully. Those are contradictory completed/no-action and failed outcomes, so this still permits a mixed success/incomplete batch. Rejectincomplete && noopbefore the no-comment return and add a regression test.
if (comments.length === 0) {
if (!incomplete && !noop) {
throw new Error('Triage output has no summary or explicit no-op/incomplete result.');
}
if (output.items.some(item => ['add_labels', 'remove_labels'].includes(item.type))) {
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+26
to
+30
| function meaningful(value) { | ||
| const text = value.replace(/[*_`]/g, '').trim(); | ||
| return /[\p{L}\p{N}]/u.test(text) && | ||
| !/^<[\s\S]*>$/.test(text) && | ||
| !/^(?:todo|tbd|test(?: message)?(?: please ignore)?|placeholder)$/i.test(text); |
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.
Summary
Repair the safe-output submission failure behind #4704. In the recorded run for #4193,
jqpayload preparation was denied by the shell allowlist. The agent then submitted a diagnostictest message please ignorecomment, consumed the one-comment quota, and could not publish its real triage summary.jqand document separate, checked JSON payload preparation followed by exactly onesafeoutputs add_comment .submission. Explicitly prohibit diagnostic writes,-/@-body experiments, and retries after a submission error.Validation
gh aw compilesucceeds; repeating compilation leaves the generated lock byte-for-byte unchanged.git diff --checkpasses.Rollout and recovery
Related to #4704; intentionally do not close that tracker on merge. The previously reported completion count included workflow-attributed placeholders and is being re-audited. This PR fixes the workflow, not the existing backlog results.
After this reaches the default branch, verify a small representative pilot, retry only genuinely incomplete issues in completion-gated batches within the existing daily credit budget, and delete confirmed placeholder comments only after replacement summaries succeed. Keep #4704 open until recovery is verified. No backlog retries or comment deletions are included in this PR.
Checklist