You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[aw-failures] [aw-fix] P1: PR Code Quality Reviewer — safe-outputs review 422 "can not request changes on your own PR" on *-mine
[Content truncated due to length] #47390
Fix the PR-review safe-output path to downgrade REQUEST_CHANGES→COMMENT (and drop unresolvable line comments) when the PR is authored by the workflow's own identity — it hard-fails every review on maintainer/bot *-miner PRs.
Problem
The safe_outputs job fails outright when the reviewer targets a PR whose author is the same identity the workflow runs as. GitHub pulls.createReview returns 422 "Review Can not request changes on your own pull request", and the body-only retry fails identically. Result: 4/4 safe outputs failed, review never posted.
Every copilot/*-branch run in the same window succeeded → the failure tracks author-identity, not infra.
Evidence
Two 422 signatures in one finalization of §29946005059:
create_pull_request_review_comment → 422 "Line could not be resolved and Line could not be resolved" (unresolvable diff lines) → falls back to body-only review.
submit_pull_request_review (event REQUEST_CHANGES) → 422 "Review Can not request changes on your own pull request" (non-retryable). The body-only retry keeps the same event and fails identically.
audit-diff (§29946005059 vs successful §29947043700): no firewall anomalies, no tooling/MCP drift, comparable metrics (10 vs 12 API calls). Confirms a pure API-policy failure, not a code/infra regression.
Probable root cause
The safe-outputs PR-review finalizer unconditionally submits event=REQUEST_CHANGES with line-anchored comments without (a) checking whether the PR author equals the reviewing identity, or (b) validating comment lines are resolvable in the diff. GitHub rejects self-authored REQUEST_CHANGES with a non-retryable 422; the body-only fallback reuses the same event, so it also fails.
Proposed remediation
Detect self-authored PRs (PR author login == workflow token identity) and downgrade REQUEST_CHANGES/APPROVE → COMMENT before submission.
On "Line could not be resolved", drop the unresolvable comments and submit the remaining valid ones — and ensure the body-only fallback also switches to event=COMMENT so it can succeed on self-authored PRs.
If nothing remains postable after downgrade, emit a clean noop instead of hard-failing the job.
Success criteria / verification
Reviewer run on a *-miner/self-authored PR completes with a posted COMMENT review (or clean noop); safe_outputs job green.
No 422 "can not request changes on your own pull request" in Process Safe Outputs logs.
Fix the PR-review safe-output path to downgrade
REQUEST_CHANGES→COMMENT(and drop unresolvable line comments) when the PR is authored by the workflow's own identity — it hard-fails every review on maintainer/bot*-minerPRs.Problem
The
safe_outputsjob fails outright when the reviewer targets a PR whose author is the same identity the workflow runs as. GitHubpulls.createReviewreturns422 "Review Can not request changes on your own pull request", and the body-only retry fails identically. Result: 4/4 safe outputs failed, review never posted.Affected workflow / runs
.github/workflows/pr-code-quality-reviewer.lock.yml)linter-miner/stringbytesroundtrip..., 2026-07-22 18:17Z (PR [linter-miner] feat(linters): add stringbytesroundtrip linter #47375)eslint-miner/require-fs-io-try-catch..., 2026-07-22 09:59Zcopilot/*-branch run in the same window succeeded → the failure tracks author-identity, not infra.Evidence
Two 422 signatures in one finalization of §29946005059:
create_pull_request_review_comment→422 "Line could not be resolved and Line could not be resolved"(unresolvable diff lines) → falls back to body-only review.submit_pull_request_review(eventREQUEST_CHANGES) →422 "Review Can not request changes on your own pull request"(non-retryable). The body-only retry keeps the same event and fails identically.audit-diff(§29946005059 vs successful §29947043700): no firewall anomalies, no tooling/MCP drift, comparable metrics (10 vs 12 API calls). Confirms a pure API-policy failure, not a code/infra regression.Probable root cause
The safe-outputs PR-review finalizer unconditionally submits
event=REQUEST_CHANGESwith line-anchored comments without (a) checking whether the PR author equals the reviewing identity, or (b) validating comment lines are resolvable in the diff. GitHub rejects self-authoredREQUEST_CHANGESwith a non-retryable 422; the body-only fallback reuses the same event, so it also fails.Proposed remediation
REQUEST_CHANGES/APPROVE→COMMENTbefore submission."Line could not be resolved", drop the unresolvable comments and submit the remaining valid ones — and ensure the body-only fallback also switches toevent=COMMENTso it can succeed on self-authored PRs.noopinstead of hard-failing the job.Success criteria / verification
*-miner/self-authored PR completes with a postedCOMMENTreview (or clean noop);safe_outputsjob green.422 "can not request changes on your own pull request"inProcess Safe Outputslogs.COMMENTreview successfully.Parent: #44298 (PR Code Quality Reviewer reliability). Analyzed runs: 29946005059, 29910168345, 29947043700.
Related to #44298