Skip to content

fix: Enforce review quota before AI work#107

Open
JuliusWallblom wants to merge 2 commits into
mainfrom
fix/prevent-review-without-quota
Open

fix: Enforce review quota before AI work#107
JuliusWallblom wants to merge 2 commits into
mainfrom
fix/prevent-review-without-quota

Conversation

@JuliusWallblom
Copy link
Copy Markdown
Contributor

Summary

  • Disables internal repository settings before webhook review work when quota is exhausted.
  • Treats enabled repositories without an organization as ineffective so they cannot bypass quota accounting.
  • Fixes the local review quota boundary so zero-credit orgs are rejected at used >= total.
  • Adds BFF route coverage for quota-exhausted, quota-available, and missing-organization settings responses.

Validation

  • bun test apps/bff/src/routes/internal.test.ts
  • bunx tsc --noEmit --project apps/bff/tsconfig.json
  • bun run --cwd apps/review-agent typecheck
  • bunx biome check apps/bff/src/routes/internal.ts apps/bff/src/routes/internal.test.ts apps/bff/src/routes/reviews/local.ts apps/review-agent/src/index.ts packages/shared/src/types/index.ts

Note: Full bun run check still reports pre-existing formatting/lint issues outside this change, and the full review-agent test suite still has an unrelated GitHubClient.validateReviewComments failure.

@github-actions
Copy link
Copy Markdown

Preview Deployment

Service URL
Website https://pr-107.opendiff.dev
App https://pr-107-app.opendiff.dev
API https://pr-107-api.opendiff.dev
Agent https://pr-107-agent.opendiff.dev

Updated: 2026-05-17 20:00:59 UTC

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.

1 participant