Repository navigation
feat(agent): minimal quota gate and single-flight lock for agy review (#221) - #223
Merged
Merged
Conversation
…221) Scope reduced per review: admission control only, no scheduler/queue. --min-remaining probes /quota before the model call and fails closed as quota-exhausted; a default O_EXCL single-flight lock serializes reviews (deferred on contention, 30min staleness, --no-exclusive opt-out). Both gates wrap local and Herdr executors; run-file skips them. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 21 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Pre-merge review findings on #221: - minQuotaFraction now drops buckets only when their group names a different known quota family, so --model no longer gates on unrelated exhausted groups; unrecognized names still fail closed on all buckets. - The single-flight lock mtime is refreshed while the holder runs, so the 30min staleness reclaim only fires for dead/hung holders and cannot steal the lock from a legitimately long --timeout run. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This was referenced Nov 23, 2026
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
Stacked on #222 (
219head). Implements Issue #221 at the reduced scope agreed in review: admission control only — no queue, scheduler, quota DB, or new Herdr worker management.--min-remaining <0..1>: runsagy -p "/quota"before the model call; worst-bucket remaining fraction below threshold (or unreadable) →quota-exhaustedwithout invoking the model. Fail-closed.$AGENT_STATE_DIR/agy-review/.single-flight.lock: atomicO_EXCL, 30 min staleness, ID-checked release,--no-exclusiveopt-out →deferredon contention.--executor herdr; innerrun-fileskips them (outer dispatch owns admission).agent review quotasubcommand prints normalized buckets.quota-exhausted/deferred; exit 0 still only forreview-completed.Test plan
bun test script/agent.agy-review.test.ts— 28 pass (gate, lock, stale/foreign lock, run-file skip)tsc --noEmit,./script/test,./script/test-workflow,./script/check-secrets— passreview quotareturns live buckets;--min-remaining 0.999→quota-exhaustedwith quota snapshot, model not calledGenerated with Devin