Skip to content

fix(ai-gateway): scope model rate limits by flag - #4994

Merged
chrarnoldus merged 1 commit into
mainfrom
general-parenthesis
Aug 4, 2026
Merged

chrarnoldus merged 1 commit into
mainfrom
general-parenthesis

Conversation

@chrarnoldus

Copy link
Copy Markdown
Contributor

Summary

  • add a rate-limited Kilo-exclusive model flag
  • apply request and anonymous promotion limits only to flagged models, regardless of pricing
  • mark only the free Gemma model as rate-limited

Verification

  • NODE_ENV=test pnpm --filter web exec jest --runInBand --runTestsByPath "src/lib/ai-gateway/models.test.ts" "src/app/api/openrouter/[...path]/route.test.ts"
  • pnpm --filter web typecheck
  • pnpm exec oxlint --config .oxlintrc.json <changed files>
  • pnpm exec oxfmt --check <changed files>
  • git diff --check

@chrarnoldus chrarnoldus self-assigned this Aug 4, 2026
@kilo-code-bot

kilo-code-bot Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
apps/web/src/app/api/openrouter/[...path]/route.ts 372 Flag-only rate-limit check drops coverage for kilo-auto/free (never resolves to the flagged Gemma model) and experiment public ids — both are now unmetered for anonymous traffic and unlogged in free_model_usage
Files Reviewed (6 files)
  • apps/web/src/app/api/openrouter/[...path]/route.ts - 1 issue
  • apps/web/src/app/api/openrouter/[...path]/route.test.ts - 0 issues
  • apps/web/src/lib/ai-gateway/models.ts - 0 issues
  • apps/web/src/lib/ai-gateway/models.test.ts - 0 issues
  • apps/web/src/lib/ai-gateway/providers/google.ts - 0 issues
  • apps/web/src/lib/ai-gateway/providers/kilo-exclusive-model.ts - 0 issues

Fix these issues in Kilo Cloud


Reviewed by kimi-k3 · Input: 98.3K · Output: 14.4K · Cached: 746.8K

Review guidance: REVIEW.md from base branch main

@chrarnoldus
chrarnoldus merged commit 1f4ba5b into main Aug 4, 2026
16 checks passed
@chrarnoldus
chrarnoldus deleted the general-parenthesis branch August 4, 2026 10:11
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.

3 participants