chore(ci): cut Codex review cost via path filters, hash skip, draft skip#345
Open
chore(ci): cut Codex review cost via path filters, hash skip, draft skip#345
Conversation
Codex PR review was running at gpt-5.4 / effort high on every push, including drafts and noise-only pushes (lockfile, snapshots, build artifacts). Cost was unsustainable. - Drop reasoning effort from high to medium - Skip draft PRs entirely; trigger on ready_for_review for the first non-draft run - Add paths-ignore on the trigger and a matching in-job diff filter so the model only sees real code changes - Compute SHA-256 of the filtered diff and skip silently when a prior review or skip-comment already carries the same hash marker (kills rebase/sync churn) - Cap reviewable diffs at 5,000 lines; post a single comment suggesting a split and embed the hash so subsequent re-pushes of the same diff stay silent Verified with actionlint and traced through normal/rebase/oversize/mixed-push scenarios.
A JSON-parse failure is transient (model hiccup or codex-action error), but the failure review previously embedded the diff-hash marker. The next run on the same diff would then match the marker and silently skip, turning a transient failure into a permanent one. Drop the marker from the parse-failure path only. All other code paths (successful review, no-issues-found, all-comments-dropped, size-cap notice) still embed the marker so genuine successes and permanent skips remain idempotent across re-pushes.
…-of-diff If Codex returns comments but every one targets lines outside the right-side diff, that is almost always a line-mapping failure rather than a real "no issues" signal. Embedding the hash marker in that case turns a transient model failure into a permanent skip for the same patch. Drop the marker on the all-dropped path; only the genuine no-findings case (zero comments returned) and successful inline reviews still stamp the marker, so re-pushes of identical diffs only short-circuit when the prior run actually produced a usable review.
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.
Summary
Codex PR review was running at
gpt-5.4/effort: highon every push, including drafts and noise-only pushes. Cost was unsustainable. This PR ships options A and B from the cost-reduction brainstorm:high→mediumready_for_review(or non-draftopened)paths-ignoreon the trigger plus a matching in-job filter so the model only sees real code (lockfile, snapshots, dist, turbo cache, node_modules, CHANGELOGs, logs, LICENSE, knip.json, top-level data/snapshots all excluded)A follow-up PR will add the local pre-push hook (option C from the brainstorm).
Verification
actionlintpasses cleanTest plan
mediumeffortpnpm-lock.yamldoes not trigger the workflowpnpm-lock.yamltriggers, but the model's diff excludes the lockfile🤖 Generated with Claude Code