Skip to content

refactor(ai-gateway): isolate OpenRouter display pricing - #4861

Merged
chrarnoldus merged 7 commits into
mainfrom
refactor-openrouter-pricing-module
Jul 29, 2026
Merged

refactor(ai-gateway): isolate OpenRouter display pricing#4861
chrarnoldus merged 7 commits into
mainfrom
refactor-openrouter-pricing-module

Conversation

@chrarnoldus

@chrarnoldus chrarnoldus commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Depends on #4859. This stacked PR must merge after its base PR.

Summary

  • extract OpenRouter display-pricing helpers into a lightweight provider module
  • import display pricing directly in the cached endpoints route
  • preserve provider-index exports and GPT-5.6 promotion behavior
  • move focused discount and promotion tests alongside the new module

Testing

  • pnpm exec oxfmt on the five changed files
  • pnpm --filter web test --runInBand --runTestsByPath ... (3 suites, 40 tests)
  • pnpm --filter web lint -- ... (0 warnings, 0 errors)
  • pnpm --filter web typecheck

@chrarnoldus chrarnoldus self-assigned this Jul 29, 2026
@kilo-code-bot

kilo-code-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

This is a pure refactor extracting OpenRouter display-pricing helpers into a dedicated module, with backwards-compatible re-exports and no behavioral changes.

Files Reviewed (5 files)
  • apps/web/src/app/api/openrouter/models/[provider]/[model]/endpoints/route.ts
  • apps/web/src/lib/ai-gateway/providers/openrouter/display-pricing.ts
  • apps/web/src/lib/ai-gateway/providers/openrouter/display-pricing.test.ts
  • apps/web/src/lib/ai-gateway/providers/openrouter/index.ts
  • apps/web/src/lib/ai-gateway/providers/openrouter/index.test.ts

Reviewed by claude-sonnet-5 · Input: 30 · Output: 4.1K · Cached: 628.6K

Review guidance: REVIEW.md from base branch add-openrouter-gateway-endpoints

Base automatically changed from add-openrouter-gateway-endpoints to main July 29, 2026 14:53
@chrarnoldus
chrarnoldus merged commit 4c1148e into main Jul 29, 2026
15 checks passed
@chrarnoldus
chrarnoldus deleted the refactor-openrouter-pricing-module branch July 29, 2026 16:00
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