Skip to content

fix(codex-review): gate on commit/creation time, not updatedAt#22

Merged
ANcpLua merged 1 commit into
mainfrom
automation/codex-review-active-window
May 29, 2026
Merged

fix(codex-review): gate on commit/creation time, not updatedAt#22
ANcpLua merged 1 commit into
mainfrom
automation/codex-review-active-window

Conversation

@ANcpLua
Copy link
Copy Markdown
Owner

@ANcpLua ANcpLua commented May 29, 2026

Incident + fix

The first run of codex-review.yml swept every open PR fleet-wide and posted @codex review on 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 is disabled_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 bumps updatedAt, so every PR we touch looks "active" → infinite re-trigger.

Fix

ensure_review now gates on ACTIVE_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_dispatch of a single PR still bypasses the window.

🤖 Generated with Claude Code

… 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>
@ANcpLua ANcpLua merged commit d32e2ae into main May 29, 2026
@ANcpLua ANcpLua deleted the automation/codex-review-active-window branch May 29, 2026 20:42
@chatgpt-codex-connector
Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant