Skip to content

refactor(ai-gateway): colocate response rewriters - #5136

Merged
chrarnoldus merged 1 commit into
mainfrom
refactor/ai-gateway-response-rewriter
Aug 7, 2026
Merged

chrarnoldus merged 1 commit into
mainfrom
refactor/ai-gateway-response-rewriter

Conversation

@chrarnoldus

Copy link
Copy Markdown
Contributor

Summary

  • move response rewriting implementation and tests into the AI gateway module
  • replace exported positional rewrite APIs with named parameter objects
  • require nullable values for absent capture, request ID, and response transform data

Testing

  • pnpm --filter web exec jest --runInBand --forceExit --runTestsByPath src/lib/ai-gateway/rewriteModelResponse.test.ts src/app/api/openrouter/[...path]/route.test.ts
  • pnpm --filter web typecheck
  • focused lint and formatting checks

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

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

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Pure mechanical refactor moving the response rewriter into ai-gateway and converting positional parameters to named parameter objects; all call sites, mocks, and assertions verified consistent with no behavioral changes.

Files Reviewed (4 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/rewriteModelResponse.ts
  • apps/web/src/lib/ai-gateway/rewriteModelResponse.test.ts

Reviewed by kimi-k3 · Input: 54.9K · Output: 8.2K · Cached: 433.4K

Review guidance: REVIEW.md from base branch main

@chrarnoldus
chrarnoldus merged commit d058ca9 into main Aug 7, 2026
13 of 15 checks passed
@chrarnoldus
chrarnoldus deleted the refactor/ai-gateway-response-rewriter branch August 7, 2026 14:05
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.

2 participants