Skip to content

[aw-failures] Reviewer safe_outputs hard-fails on locked PRs — 422 "lock prevents review" aborts run despite successful agent #41135

Description

@github-actions

Problem statement

Make submit_pull_request_review / create_pull_request_review_comment treat a locked-PR 422 as a skipped outcome, not a job failure — two reviewer workflows aborted in the last 6h even though their agent jobs fully succeeded.

When a target PR has locked: true, POST /repos/.../pulls/{n}/reviews returns 422 Unprocessable Entity: "lock prevents review" (correctly classified non-retryable). The safe_outputs handler then exits 1 and fails the whole run, discarding a valid agent-produced review.

Affected workflows and run IDs

Workflow Run safe_outputs job Agent job
PR Code Quality Reviewer §28067859956 failed (1/2 msgs) success (1472-char review)
Matt Pocock Skills Reviewer §28067859912 failed (3/4 msgs) success (review + 2 comments)

Both targeted PR #41129 ("Bump default gh-aw-firewall to v0.27.9 and gh-aw-mcpg to v0.3.29"), confirmed via API: locked: true, state: open, merged: false, active_lock_reason: null.

Evidence

Identical non-retryable 422 in both runs
Submitting PR review on github/gh-aw#41129: event=APPROVE, comments=0, bodyLength=1932
POST /repos/github/gh-aw/pulls/41129/reviews - 422 ...
##[error]Failed to submit PR review: ERR_API: pulls.createReview github/gh-aw#41129 failed (attempt 1)
Original error: Unprocessable Entity: "lock prevents review"
Retryable: false

Processing summary (Matt Pocock run): Total 4, Successful 1, Failed 3create_check_run succeeded; the buffered submit_pull_request_review + 2 create_pull_request_review_comment all failed at review finalization because the single createReview call was rejected.

Probable root cause

The review-finalization path has no special handling for a locked PR. A locked conversation is a legitimate, expected external state (a maintainer locked #41129), yet every automated reviewer that fires against it hard-fails its safe_outputs job. The failure is downstream of a successful agent run, so it produces pure noise and red runs with no actionable defect in the agent itself.

Proposed remediation

  1. In the PR-review finalization handler, detect the 422 with message lock prevents review (or pre-check pulls/{n}.locked before submitting) and treat it as a soft skip: emit a ##[warning] + step-summary note ("review skipped — PR is locked"), mark the message as skipped, and do not exit non-zero.
  2. Keep buffered review comments together with the parent review decision so a single skipped createReview reports as one skipped item, not N independent failures.
  3. Optionally surface a pr_locked conclusion output so audits can track frequency.

Success criteria / verification

  • A reviewer workflow targeting a locked PR completes with conclusion=success (or neutral), logging that review submission was skipped due to the lock.
  • safe_outputs no longer counts a locked-PR review as a failed message; the run is green.

Scope notes (assessed, no action)

  • Smoke CI MCP Gateway §28068066318 — gateway exited 1 at startup (no gateway logs, agent never ran). Transient: Smoke CI succeeded immediately before (00:57) and after (01:26); audit-diff vs the prior success shows no firewall/tooling/MCP drift. P2, no issue filed.
  • Daily BYOK Ollama Test §28062125221 — no distinct error signature in logs; external-BYOK probe, P2.
  • Smoke CI §28060680078 was cancelled, not a failure.

Parent: failure report #39883. Analyzed runs: 28067859956, 28067859912, 28068066318, 28062125221.
Related to #39883

Generated by 🔍 [aw] Failure Investigator (6h) · 163.4 AIC · ⌖ 14.4 AIC · ⊞ 5.3K ·

  • expires on Jun 30, 2026, 5:33 PM UTC-08:00

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions