Skip to content

fix: widen /codex:review wait threshold to ~5 files / 200 lines#315

Open
robertbpugh wants to merge 2 commits into
openai:mainfrom
robertbpugh:widen-codex-review-wait-threshold
Open

fix: widen /codex:review wait threshold to ~5 files / 200 lines#315
robertbpugh wants to merge 2 commits into
openai:mainfrom
robertbpugh:widen-codex-review-wait-threshold

Conversation

@robertbpugh
Copy link
Copy Markdown

Summary

Widen the wait/background threshold in /codex:review from "1-2 files" to "up to 5 files or 200 lines of diff."

Motivation

The current threshold trips on most real PRs. Even a 3-file fix asks "wait or background?", and the answer is "wait." Codex finishes inside the prompt-cache window.

Concrete case: a 3-file / 43-line wp-calypso review today hit the prompt. Codex finished in about 2 minutes. The 5-minute cache window was nowhere near expiring. The dispatcher prompt was pure round-trip cost.

5 files / 200 lines covers the small-PR case without losing the background recommendation for refactors, where the cache miss is already priced in.

Test plan

  • /codex:review on a 3-file / 50-line diff recommends "Wait for results"
  • /codex:review on a 10-file / 500-line diff recommends "Run in background"
  • --wait / --background flags still bypass the dispatcher

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 47d000052b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread plugins/codex/commands/review.md Outdated
- Treat untracked files or directories as reviewable work even when `git diff --shortstat` is empty.
- Only conclude there is nothing to review when the relevant working-tree status is empty or the explicit branch diff is empty.
- Recommend waiting only when the review is clearly tiny, roughly 1-2 files total and no sign of a broader directory-sized change.
- Recommend waiting when the review is small, roughly up to 5 files or 200 lines of diff, with no sign of a broader directory-sized change. Codex finishes within Claude's prompt cache window (5 minutes) for diffs of this size, so wait in the foreground and the result feeds the next step.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Gate foreground recommendation on both size thresholds

Using or here makes large diffs qualify as “wait” whenever just one dimension is small (for example, a 1-file/1500-line refactor or a 9-file/80-line sweep), which contradicts the stated “small review” intent and can push long reviews into foreground mode where the user is blocked and cache-window assumptions no longer hold. The recommendation should require both limits (or an equivalent combined smallness check), not either one independently.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the /codex:review command’s execution-mode guidance so that small reviews more often run in the foreground (to avoid unnecessary wait/background prompting) and larger/unclear reviews continue to be recommended for background execution.

Changes:

  • Widened the “recommend wait” threshold from ~1–2 files to ~5 files or ~200 lines.
  • Added rationale tying the foreground recommendation to staying within the prompt-cache window for small diffs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugins/codex/commands/review.md Outdated
@robertbpugh
Copy link
Copy Markdown
Author

@copilot apply changes based on the comments in this thread

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8b358db1c1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

- Treat untracked files or directories as reviewable work even when `git diff --shortstat` is empty.
- Only conclude there is nothing to review when the relevant working-tree status is empty or the explicit branch diff is empty.
- Recommend waiting only when the review is clearly tiny, roughly 1-2 files total and no sign of a broader directory-sized change.
- Recommend waiting when the review is small, roughly up to 5 files or about 200 insertions+deletions as reported by `git diff --shortstat`, with no sign of a broader directory-sized change. Codex finishes within Claude's prompt cache window (5 minutes) for changes of this size, so wait in the foreground and the result feeds the next step.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Require both thresholds before recommending foreground wait

Change this condition to require both the file-count and line-count limits, not either one. As written (up to 5 files or about 200 insertions+deletions), very large reviews still get a foreground recommendation whenever one dimension is small (for example, a 1-file/1500-line rewrite or an 8-file/80-line sweep), which contradicts the “small review” gate and can block users on long-running reviews.

Useful? React with 👍 / 👎.

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.

2 participants