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
⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.
Context
maybeProcessPrPanelRetrigger in src/queue/processors.ts (~line 14016) has an explicit pr.state !== "open" guard, added for #9020 ("panel re-run checkbox on a closed/merged PR
does real work, then silently no-ops"). Its doc comment explains why: the PR-panel comment is
deliberately preserved after merge/close, its checkboxes stay interactive on GitHub forever, and
without the guard a post-merge click would spend a real gate evaluation and live CI reads before
dying deep in the pipeline with no user-visible feedback.
Two structurally identical handlers never got the same guard:
maybeProcessPrPanelGenerateTests (~line 14175, the checkbox handler, #4589) — goes
straight from authorization → feature-flag check → mode check → runE2eTestGenerationAndDeliver,
with no PR-state check anywhere in the function. On a merged/closed PR whose checkbox is still
checkable, this spends a real AI test-generation call, and in commit delivery mode calls commitE2eTestToPrBranch (src/github/e2e-test-commit.ts:43), which only declines if the live
head SHA/ref no longer matches the cached PR — it does not check PR state, so it can
silently push a new commit onto an already-merged branch.
maybeProcessGenerateTestsCommand (~line 13466, the @loopover generate-tests text-command
twin) has the identical gap: no pr.state !== "open" check before authorization/generation.
test/unit/queue-5.test.ts's "PR-panel generate-tests checkbox (#4589)" block
(seedCheckboxPr) hardcodes state: "open" in every case — no test exercises a closed/merged PR
for either handler.
Requirements
Both maybeProcessPrPanelGenerateTests and maybeProcessGenerateTestsCommand must add a pr.state !== "open" guard that skips (records a skip outcome and returns, same shape as maybeProcessPrPanelRetrigger's "pr_not_open" skip) before doing any authorization, AI
generation, or commit work.
Place the guard in the same relative position maybeProcessPrPanelRetrigger uses it (after the
cached-PR-missing check, before authorization) for both functions.
Use each function's own existing skip-recording helper (mirror recordGenerateTestsSkip's
existing call shape for the "cached_pr_missing"/other skip reasons already in that function) with
a "pr_not_open" reason string, matching maybeProcessPrPanelRetrigger's convention.
Do not modify maybeProcessPrPanelRetrigger itself — it is already correct and is the precedent.
maybeProcessGenerateTestsCommand in src/queue/processors.ts gains the identical guard.
test/unit/queue-5.test.ts's generate-tests checkbox suite gains a case with a closed/merged
PR asserting the handler skips with "pr_not_open" and never calls the AI generation path.
The equivalent text-command test suite for maybeProcessGenerateTestsCommand gains the same
closed/merged-PR skip assertion.
All four deliverables are required in this single PR.
Test Coverage Requirements
This repo enforces 99%+ Codecov patch coverage, branch-counted, on every changed line/branch in src/**. Both new guards and their two new test cases above must be covered.
Expected Outcome
Checking the generate-tests checkbox, or invoking @loopover generate-tests, on a closed or
merged PR no longer spends a real AI generation call or risks committing a test onto an
already-merged branch — it skips immediately with a "pr_not_open" outcome, matching the fix
already applied to the sibling retrigger checkbox in #9020.
Links & Resources
src/queue/processors.ts (maybeProcessPrPanelRetrigger ~line 14016 — precedent; the two
functions to fix: maybeProcessPrPanelGenerateTests ~14175, maybeProcessGenerateTestsCommand
~13466)
src/github/e2e-test-commit.ts:43 (commitE2eTestToPrBranch — confirms it doesn't check PR
state itself, only head SHA/ref)
Context
maybeProcessPrPanelRetriggerinsrc/queue/processors.ts(~line 14016) has an explicitpr.state !== "open"guard, added for #9020 ("panel re-run checkbox on a closed/merged PRdoes real work, then silently no-ops"). Its doc comment explains why: the PR-panel comment is
deliberately preserved after merge/close, its checkboxes stay interactive on GitHub forever, and
without the guard a post-merge click would spend a real gate evaluation and live CI reads before
dying deep in the pipeline with no user-visible feedback.
Two structurally identical handlers never got the same guard:
maybeProcessPrPanelGenerateTests(~line 14175, the checkbox handler,#4589) — goesstraight from authorization → feature-flag check → mode check →
runE2eTestGenerationAndDeliver,with no PR-state check anywhere in the function. On a merged/closed PR whose checkbox is still
checkable, this spends a real AI test-generation call, and in
commitdelivery mode callscommitE2eTestToPrBranch(src/github/e2e-test-commit.ts:43), which only declines if the livehead SHA/ref no longer matches the cached PR — it does not check PR state, so it can
silently push a new commit onto an already-merged branch.
maybeProcessGenerateTestsCommand(~line 13466, the@loopover generate-teststext-commandtwin) has the identical gap: no
pr.state !== "open"check before authorization/generation.test/unit/queue-5.test.ts's"PR-panel generate-tests checkbox (#4589)"block(
seedCheckboxPr) hardcodesstate: "open"in every case — no test exercises a closed/merged PRfor either handler.
Requirements
maybeProcessPrPanelGenerateTestsandmaybeProcessGenerateTestsCommandmust add apr.state !== "open"guard that skips (records a skip outcome and returns, same shape asmaybeProcessPrPanelRetrigger's"pr_not_open"skip) before doing any authorization, AIgeneration, or commit work.
maybeProcessPrPanelRetriggeruses it (after thecached-PR-missing check, before authorization) for both functions.
recordGenerateTestsSkip'sexisting call shape for the "cached_pr_missing"/other skip reasons already in that function) with
a
"pr_not_open"reason string, matchingmaybeProcessPrPanelRetrigger's convention.maybeProcessPrPanelRetriggeritself — it is already correct and is the precedent.Deliverables
maybeProcessPrPanelGenerateTestsinsrc/queue/processors.tsgains thepr.state !== "open"guard with a"pr_not_open"skip outcome, mirroringmaybeProcessPrPanelRetrigger's orb(review): panel re-run checkbox on a closed/merged PR does real work, then silently no-ops #9020 fix exactly.maybeProcessGenerateTestsCommandinsrc/queue/processors.tsgains the identical guard.test/unit/queue-5.test.ts's generate-tests checkbox suite gains a case with a closed/mergedPR asserting the handler skips with
"pr_not_open"and never calls the AI generation path.maybeProcessGenerateTestsCommandgains the sameclosed/merged-PR skip assertion.
All four deliverables are required in this single PR.
Test Coverage Requirements
This repo enforces 99%+ Codecov patch coverage, branch-counted, on every changed line/branch in
src/**. Both new guards and their two new test cases above must be covered.Expected Outcome
Checking the generate-tests checkbox, or invoking
@loopover generate-tests, on a closed ormerged PR no longer spends a real AI generation call or risks committing a test onto an
already-merged branch — it skips immediately with a
"pr_not_open"outcome, matching the fixalready applied to the sibling retrigger checkbox in #9020.
Links & Resources
src/queue/processors.ts(maybeProcessPrPanelRetrigger~line 14016 — precedent; the twofunctions to fix:
maybeProcessPrPanelGenerateTests~14175,maybeProcessGenerateTestsCommand~13466)
src/github/e2e-test-commit.ts:43(commitE2eTestToPrBranch— confirms it doesn't check PRstate itself, only head SHA/ref)
test/unit/queue-5.test.ts(existing test file to extend)