fix(ai-review): cap BYOK daily review usage - #683
Conversation
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
gittensory · advisory review Reviewed 5 changed file(s) — two independent AI reviewers. Suggested action: ✅ Safe to merge — both reviewers found no blocking issues. Reviewer A · Suggestions
Worth double-checking
Reviewer B · Suggestions
Worth double-checking
|
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 64a6723 | Commit Preview URL Branch Preview URL |
Jun 14 2026, 02:15 PM |
Motivation
Description
runGittensoryAiReviewbefore any external provider request is made, using an environment-configurableAI_BYOK_DAILY_REPO_LIMITand aDEFAULT_BYOK_DAILY_REPO_LIMITfallback.countByokAiReviewEventsForRepoSinceinsrc/db/repositories.tsto count successful BYOKai_review_prevents for a repo since UTC day start and import it intosrc/services/ai-review.tsto enforce the cap.AI_BYOK_DAILY_REPO_LIMITto the typedEnv(src/env.d.ts) and populate the default inwrangler.jsonc, and update unit tests intest/unit/ai-review.test.tsto cover the per-repo BYOK quota behavior.Testing
git diff --checkwhich completed with no issues.npm run typecheckwhich failed due to missing local type dependencies (typecheck blocked by absent dev deps in this environment).npx vitest run test/unit/ai-review.test.tswhich could not run because the environment could not fetch dev dependencies from the npm registry (403 Forbidden), though tests were updated to assert the new BYOK quota behavior.Codex Task