Skip to content

ci(pr-automation): retry failed automation by comment - #2103

Open
Benoît Cortier (CBenoit) wants to merge 5 commits into
masterfrom
cbenoit-pr-automation-retry-command
Open

Benoît Cortier (CBenoit) wants to merge 5 commits into
masterfrom
cbenoit-pr-automation-retry-command

Conversation

@CBenoit

@CBenoit Benoît Cortier (CBenoit) commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Allow a PR author or repository writer to request a non-forced retry only for a current exact-head classification or review failure.

Bind admission to the comment, failure, head, and stage with a one-hour server-time cooldown and three accepted retries per head and stage. Bound dispatch revalidates the failure before lease admission; all dispatch errors, including HTTP 422, retain the admission to avoid duplicate model work.

Allow a PR author or repository writer to request a non-forced retry only for a current exact-head classification or review failure.

Bind admission to the comment, failure, head, and stage with a one-hour server-time cooldown and three accepted retries per head and stage. Ambiguous dispatch errors retain the admission to avoid duplicate model work.
Copilot AI balanced review requested due to automatic review settings October 9, 2026 15:39
@github-actions github-actions Bot added risk/low Self-contained change with no cross-crate behavioral effect scope/tooling Build, CI, release, or developer tooling size/L Size: up to 899 counted lines and 20 files; exceeds M in either measure labels Oct 9, 2026

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.

🟡 Changes recommended

Dispatch is not fully bound to admitted state, definite rejections consume retries, and the new tests are absent from CI.

3 open findings
What changed in this PR

Adds trusted comment-triggered retries for failed PR classification or review automation.

Changes:

  • Adds @github-actions retry handling with authorization and eligibility checks.
  • Adds cooldown, retry limits, admission receipts, tests, and documentation.
  • Dispatches ordinary non-forced automation routes.

Protocol review was not applicable because no RDP protocol behavior changed.

File Description
.github/​workflows/​review-pipeline.intent.md Documents retry workflow integration.
.github/​workflows/​pr-automation-retry.yml Handles trusted retry comments.
.github/​pr-automation/​retry-command.test.js Tests retry admission behavior.
.github/​pr-automation/​retry-command.js Implements validation, receipts, and dispatch.
.github/​PR_AUTOMATION.md Documents retry policy and limits.

🧠 Review effort: Balanced

Comment thread .github/pr-automation/retry-command.js Outdated
Comment thread .github/pr-automation/retry-command.js
Comment thread .github/pr-automation/retry-command.test.js Outdated

@github-actions github-actions Bot 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.

Adds a trusted comment-triggered retry workflow for failed exact-head classification/review automation: retry-command.js validates author permission, PR/comment state, strict unambiguous check-run history, admission dedup/cooldown/cap, and a receipt-before-dispatch ordering; plus tests, workflow YAML, and docs. The admission logic is sound and fails closed on ambiguity. All three validated code-compressor findings are low-severity maintainability compressions, not defects: strictRuns duplicates automation-lease's read+canonicalize pipeline (though readCanonicalRuns is not actually exported, as the specialist claimed), the review gate re-checks completed/success already guaranteed by classValid, and snapshot contains two unfireable identity guards.

Push a commit after addressing these findings. If no code change is needed, you may resolve inline threads and comment @github-actions review-ready to request human review.

Comment thread .github/pr-automation/retry-command.js
Comment thread .github/pr-automation/retry-command.js
Comment thread .github/pr-automation/retry-command.js
@github-actions github-actions Bot added ai-reviewed/1 One automated review completed needs-author-action The pull request author is the current next actor labels Oct 9, 2026
Carry the admitted head and failed check through dispatch, resolution, and lease admission so a queued retry cannot run on a different revision or failure. Run the command tests in CI alongside the existing automation suites.
@github-actions github-actions Bot removed the needs-author-action The pull request author is the current next actor label Oct 9, 2026
Normalize workflow source line endings in the retry and review-ready script fixtures so the newly enabled Windows automation suite exercises the same embedded scripts as Linux.

@github-actions github-actions Bot 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.

The PR adds a comment-triggered, bound retry for failed exact-head classification or review automation. Independent verification of the head confirms both valid code-compressor candidates: the !classValid term in the review-stage guard (lines 148-150) is unreachable because stage === review is derived from the same unchanged classValid at line 137, and the ISO round-trip comparison in timestamp() (lines 31-32) is dead code on the sole runtime (Node/V8 in GitHub Actions), where the strict regex plus Number.isFinite already reject everything the round trip could reject. Both are low-severity maintainability simplifications; the surrounding admission/dispatch flow (fail-closed binding revalidation, receipt-before-dispatch durability, cooldown and retry limits) is internally consistent, with no additional findings.

Push a commit after addressing these findings. If no code change is needed, you may resolve inline threads and comment @github-actions review-ready to request human review.

Comment thread .github/pr-automation/retry-command.js Outdated
Comment thread .github/pr-automation/retry-command.js
@github-actions github-actions Bot added ai-reviewed/2 Two automated reviews completed needs-author-action The pull request author is the current next actor and removed ai-reviewed/1 One automated review completed labels Oct 9, 2026
The review stage is reachable only after classValid succeeds, so avoid checking that prerequisite a second time.
@github-actions github-actions Bot removed the needs-author-action The pull request author is the current next actor label Oct 10, 2026

@github-actions github-actions Bot 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.

PR 2103 adds comment-driven retry of failed automation: a trusted issue_comment workflow validates an exact-head classification/review failure, records a durable admission check run, and dispatches the ordinary pr-automation route with a bound retry binding that resolve-pr and the lease claim revalidate fail-closed. Verified both code-compressor candidates against the head: the mock's reads counter and state.onRead hook in retry-command.test.js are never exercised by any test (onRead appears only at its invocation site; assertions use readNames or afterCreate), and the quota fixture's pulls.list restub is a behavioral no-op given the base mock's identical no-op and the paginate-iterator sentinel-identity dispatch through which fork-rate-limit consumes it. Both are low-severity, test-only compressibility findings and are published as accepted. No independent production-code defects were found.

Push a commit after addressing these findings. If no code change is needed, you may resolve inline threads and comment @github-actions review-ready to request human review.

Comment thread .github/pr-automation/retry-command.test.js Outdated
Comment thread .github/pr-automation/retry-command.test.js Outdated
@github-actions github-actions Bot added ai-reviewed/3 Final automated review completed needs-author-action The pull request author is the current next actor and removed ai-reviewed/2 Two automated reviews completed labels Oct 10, 2026
Drop unused read callbacks and a duplicate quota mock override; keep the existing unavailable-quota assertion.
@github-actions github-actions Bot added needs-review A human reviewer is the current next actor and removed needs-author-action The pull request author is the current next actor labels Oct 10, 2026

This branch was successfully deployed

1 active deployment
llm-providers — 2b4ceefa Deployed Oct 10, 2026 by CBenoit via Classify pull request #2493
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-reviewed/3 Final automated review completed needs-review A human reviewer is the current next actor risk/low Self-contained change with no cross-crate behavioral effect scope/tooling Build, CI, release, or developer tooling size/L Size: up to 899 counted lines and 20 files; exceeds M in either measure

Development

Successfully merging this pull request may close these issues.

2 participants