Skip to content

Remove abuse service from AI gateway paths - #6087

Open
chrarnoldus wants to merge 1 commit into
mainfrom
kilo/remove-ai-gateway-abuse-service
Open

Remove abuse service from AI gateway paths#6087
chrarnoldus wants to merge 1 commit into
mainfrom
kilo/remove-ai-gateway-abuse-service

Conversation

@chrarnoldus

Copy link
Copy Markdown
Contributor

Summary

  • remove abuse classification calls and cached rules-engine enforcement from the shared AI gateway route
  • remove abuse cost reporting from usage processing
  • retain non-gateway auth and lifecycle event reporting plus nullable legacy usage metadata for compatibility

Validation

  • pnpm format:changed
  • local tests intentionally not run; CI will validate the change

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
@chrarnoldus chrarnoldus self-assigned this Sep 11, 2026
@kilo-code-bot

kilo-code-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

This PR cleanly removes the shared AI-gateway abuse classification, quarantine/rules-engine enforcement, and abuse cost reporting; I verified every removed export and field has no remaining references and that the retained provider/route code is internally consistent.

Files Reviewed (9 files)
  • apps/web/src/app/api/openrouter/[...path]/route.ts
  • apps/web/src/app/api/openrouter/[...path]/route.test.ts
  • apps/web/src/lib/ai-gateway/abuse-service.ts
  • apps/web/src/lib/ai-gateway/processUsage.ts
  • apps/web/src/lib/ai-gateway/processUsage.test.ts
  • apps/web/src/lib/ai-gateway/processUsage.types.ts
  • apps/web/src/lib/ai-gateway/providers/upstream-attempt.ts
  • apps/web/src/lib/proxy-error-types.ts
  • apps/web/src/lib/redis-keys.ts

Verified: no remaining references to the removed classifyAbuse/reportAbuseCost/rules-engine helpers or abuseRulesClassificationRedisKey; ProxyErrorType.abuse_blocked and the delayMs propagation are fully removed; effectiveModelIdLowerCased/accessCheckResolver are no longer reassigned so const is correct; remaining abuse_delay/abuse_downgraded_from nulls keep DB compatibility; the updated classifier-billing test matches the 400 returned by apiKindNotSupportedResponse. Tests were not executed (read-only review).


Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0

Review guidance: REVIEW.md from base branch main

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