Skip to content

feat: add throttle controls for review gate#20

Open
yupoet wants to merge 3 commits intoopenai:mainfrom
yupoet:feat/review-gate-throttle
Open

feat: add throttle controls for review gate#20
yupoet wants to merge 3 commits intoopenai:mainfrom
yupoet:feat/review-gate-throttle

Conversation

@yupoet
Copy link
Copy Markdown

@yupoet yupoet commented Mar 31, 2026

Changes: 8 files, +227 lines across 2 commits:

  1. feat: add throttle controls for review gate to prevent runaway usage
  2. fix: review gate throttle improvements from self-review

New flags:

  • --review-gate-max <n|off> — cap stop-gate reviews per session
  • --review-gate-cooldown <minutes|off> — minimum interval between reviews

Tests: 13 new tests all passing (5 config + 8 throttle logic)

yupoet and others added 2 commits March 31, 2026 09:37
The review gate can create long-running loops that drain usage limits
quickly. This adds two new setup flags to control how often it fires:

- --review-gate-max <n|off>: cap stop-gate reviews per session
- --review-gate-cooldown <minutes|off>: minimum interval between reviews

When a limit is hit, the gate is skipped (session allowed to end) and a
note is logged. Manual /codex:review still works at any time.

Co-Authored-By: yupoet <yupoet@users.noreply.github.com>
- Only count completed jobs toward session limit (not running/queued)
- Require integer for --review-gate-cooldown (no fractional minutes)
- Remove unused DEFAULT_* constants, inline null fallback
- Add comment documenting sorted-input assumption on findLastStopReviewTime
- Add 8 unit tests for checkThrottleLimits logic

Co-Authored-By: yupoet <yupoet@users.noreply.github.com>
@yupoet yupoet requested a review from a team March 31, 2026 02:06
@dkundel-openai
Copy link
Copy Markdown
Collaborator

@codex review

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