Skip to content

refactor(gateway): centralize free model response rewrites#3641

Open
kilo-code-bot[bot] wants to merge 2 commits into
mainfrom
refactor/extract-free-model-response-rewrite
Open

refactor(gateway): centralize free model response rewrites#3641
kilo-code-bot[bot] wants to merge 2 commits into
mainfrom
refactor/extract-free-model-response-rewrite

Conversation

@kilo-code-bot
Copy link
Copy Markdown
Contributor

@kilo-code-bot kilo-code-bot Bot commented Jun 1, 2026

Summary

  • Move free and stealth model response rewrite eligibility into rewriteFreeModelResponse so the route only delegates the response handling decision.
  • Keep API-specific rewrite behavior centralized while preserving the existing safe response fallback when no rewrite is needed.

Verification

  • N/A

Visual Changes

  • N/A

Reviewer Notes

  • N/A

@kilo-code-bot
Copy link
Copy Markdown
Contributor Author

kilo-code-bot Bot commented Jun 1, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Clean refactor that correctly centralizes the free/stealth model response rewrite eligibility checks into rewriteFreeModelResponse, with exact logic equivalence preserved. The incremental commit contains only a cosmetic formatting change (collapsing a two-line variable declaration onto one line) — no semantic changes.

Files Reviewed (2 files)
  • apps/web/src/app/api/openrouter/[...path]/route.ts
  • apps/web/src/lib/rewriteModelResponse.ts

Reviewed by claude-sonnet-4.6 · 185,403 tokens

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