fix(codex-review): gate on commit/creation time, not updatedAt#22
Merged
Conversation
… resurrect dormant PRs The initial central sweep posted @codex review on every open PR fleet-wide, including ~190 long-dormant #1 PRs on stale repos — wasted Codex quota and noise. Root cause: a cron sweep over ALL open PRs cannot tell an active PR from a dormant one. First attempt keyed dormancy on updatedAt, but posting a comment BUMPS updatedAt — so every PR we touch would look active and re-trigger forever. Fix: ensure_review now gates on ACTIVE_WINDOW_SECONDS (24h) measured against the head COMMIT time OR the PR CREATION time, both immune to comment churn. A PR is processed only if its code (commit) or the PR itself is recent; dormant PRs are skipped regardless of comment activity. Single-PR workflow_dispatch still bypasses the window. Grace lower-bound and the per-SHA request marker are unchanged. Also document the per-repo Codex environment prerequisite the workflow cannot satisfy. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
To use Codex here, create an environment for this repo. |
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.
Incident + fix
The first run of
codex-review.ymlswept every open PR fleet-wide and posted@codex reviewon 197 PRs — most were long-dormant#1s on stale repos. Many of those repos are Codex-configured account-wide, so real reviews ran → wasted quota. (Trigger comments and incident-window Codex review comments have been deleted; the workflow isdisabled_manually.)Root cause
A cron sweep over all open PRs can't tell an active PR from a dormant one. My first patch keyed dormancy on
updatedAt— but posting a comment bumpsupdatedAt, so every PR we touch looks "active" → infinite re-trigger.Fix
ensure_reviewnow gates onACTIVE_WINDOW_SECONDS(24h) measured against the head commit time OR PR creation time — both immune to comment churn. Verified: sampled dormant#1s (commit + creation 29d old) →SKIP(dormant). Grace lower-bound and per-SHA marker unchanged.workflow_dispatchof a single PR still bypasses the window.🤖 Generated with Claude Code