Skip to content

Remove Perplexity partner provider - #6086

Merged
chrarnoldus merged 5 commits into
mainfrom
remove-perplexity-partner-provider
Sep 18, 2026
Merged

chrarnoldus merged 5 commits into
mainfrom
remove-perplexity-partner-provider

Conversation

@chrarnoldus

@chrarnoldus chrarnoldus commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • remove percentage-routed Perplexity Kimi K3 inference and managed fallback retries
  • remove the partner routing configuration, admin controls, environment entry, and Perplexity pricing entry
  • retain generic fallback-only custom pricing support
  • retain unrelated Perplexity BYOK, embeddings, and web-search support
  • discard obsolete partner percentages when parsing persisted gateway configuration

Testing

  • CI only, as requested

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

Incremental review at 4120119e8aec260decd3fdc6d9451d39150bda6d (new commit "fix(ai-gateway): avoid disabling Kimi K3 thinking") found no issues: removing moonshotai/kimi-k3 from applyAnthropicThinkingDefault's defaultsToThinking is matched by the updated test expectation, and no other code or test still assumes Kimi K3 gets thinking: { type: 'disabled' }.

Verification Notes

  • applyAnthropicThinkingDefault now defaults thinking only for minimax/*m3* and z-ai/glm-5.2; the Kimi K3 branch is gone with no dangling references.
  • The test suite was updated consistently: Kimi K3 moved from the "disables implicit thinking" case to the "does not add thinking" case at apply-provider-specific-logic.test.ts:96, and z-ai/glm-5.1 / moonshotai/kimi-k3-fast still cover the no-op path.
  • No other test or call site (apply-provider-specific-logic.ts:350) asserts Kimi-K3 thinking-disabled behavior; the Kimi references in providers/vercel/index.test.ts are unrelated to thinking defaults.
  • isKimiModel and applyMoonshotModelSettings remain imported and used for Kimi request handling at lines 153 and 338, so removing the thinking default does not orphan imports.
Files Reviewed (2 files)
  • apps/web/src/lib/ai-gateway/providers/apply-provider-specific-logic.ts
  • apps/web/src/lib/ai-gateway/providers/apply-provider-specific-logic.test.ts
Previous Review Summaries (2 snapshots, latest commit e04a620)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit e04a620)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Incremental review at e04a6209863298ff6b4de4b1180f30e7720c6669 (new commit "fix(ai-gateway): pin Kimi thinking default") found no issues: the Kimi thinking default is now pinned to the literal moonshotai/kimi-k3, equal to the deleted PERPLEXITY_KIMI_PUBLIC_ID, and no removed partner symbols or obsolete config keys remain referenced anywhere in the changed code.

Verification Notes

  • The pinned literal moonshotai/kimi-k3 matches KIMI_CURRENT_MODEL_ID in providers/moonshotai.ts:14, so applyAnthropicThinkingDefault behavior is unchanged while no longer depending on a mutable constant.
  • KIMI_CURRENT_MODEL_ID import removal is safe: the file still uses isKimiModel and applyMoonshotModelSettings, which remain imported and used at lines 153 and 339.
  • No remaining references to perplexity_routing_percentage, DEFAULT_PERPLEXITY_PERCENTAGE, getPercentageRoutedPartnerProvider, PERPLEXITY_KIMI_PUBLIC_ID, PERPLEXITY_KIMI_PROVIDER, or partnerPricingByModelId outside the intentional compatibility test in gateway-config.test.ts:117.
  • apps/web/src/app/api/openrouter/[...path]/route.ts has no leftover partnerFallback, partnerProvider, warnExceptInTest, or getPercentageRoutedPartnerProvider references; after( remains used elsewhere.
  • RoutingContent.tsx removed all Perplexity state, handlers, and copy with no dangling references; GatewayConfigSchema strips the obsolete key for pre-existing persisted JSON.
  • Removed clone()/body.cancel() fallback code introduces no memory leaks.
Files Reviewed (24 files)
  • ENVIRONMENT.md
  • apps/web/src/app/admin/gateway/RoutingContent.tsx
  • apps/web/src/app/api/openrouter/[...path]/route.test.ts
  • apps/web/src/app/api/openrouter/[...path]/route.ts
  • apps/web/src/lib/ai-gateway/custom-pricing.test.ts
  • apps/web/src/lib/ai-gateway/custom-pricing.ts
  • apps/web/src/lib/ai-gateway/gateway-config.test.ts
  • apps/web/src/lib/ai-gateway/gateway-config.ts
  • apps/web/src/lib/ai-gateway/providers/apply-provider-specific-logic.test.ts
  • apps/web/src/lib/ai-gateway/providers/apply-provider-specific-logic.ts
  • apps/web/src/lib/ai-gateway/providers/partner/constants.ts (deleted)
  • apps/web/src/lib/ai-gateway/providers/partner/pricing.ts (deleted)
  • apps/web/src/lib/ai-gateway/providers/partner/providers.test.ts (deleted)
  • apps/web/src/lib/ai-gateway/providers/partner/providers.ts (deleted)
  • apps/web/src/lib/ai-gateway/providers/partner/routing.test.ts (deleted)
  • apps/web/src/lib/ai-gateway/providers/partner/routing.ts (deleted)
  • apps/web/src/lib/ai-gateway/providers/provider-definitions.test.ts
  • apps/web/src/lib/ai-gateway/providers/routing-config.ts
  • apps/web/src/lib/ai-gateway/providers/routing-percentage.ts
  • apps/web/src/lib/ai-gateway/providers/types.ts
  • apps/web/src/lib/ai-gateway/providers/vercel/index.test.ts
  • apps/web/src/lib/ai-gateway/rewriteModelResponse.test.ts
  • apps/web/src/lib/ai-gateway/rewriteModelResponse.ts
  • apps/web/src/routers/admin/gateway-config-router.ts

Previous review (commit 8d8a3d9)

Status: No Issues Found | Recommendation: Merge

Executive Summary

This PR cleanly removes the percentage-routed Perplexity partner provider; I verified that all removed symbols, config fields, and provider IDs have no remaining references and that the fallbackOnly removal does not change behavior for surviving custom-pricing models.

Files Reviewed (24 files)
  • ENVIRONMENT.md
  • apps/web/src/app/admin/gateway/RoutingContent.tsx
  • apps/web/src/app/api/openrouter/[...path]/route.test.ts
  • apps/web/src/app/api/openrouter/[...path]/route.ts
  • apps/web/src/lib/ai-gateway/custom-pricing.test.ts
  • apps/web/src/lib/ai-gateway/custom-pricing.ts
  • apps/web/src/lib/ai-gateway/gateway-config.test.ts
  • apps/web/src/lib/ai-gateway/gateway-config.ts
  • apps/web/src/lib/ai-gateway/providers/apply-provider-specific-logic.test.ts
  • apps/web/src/lib/ai-gateway/providers/apply-provider-specific-logic.ts
  • apps/web/src/lib/ai-gateway/providers/partner/constants.ts (deleted)
  • apps/web/src/lib/ai-gateway/providers/partner/pricing.ts (deleted)
  • apps/web/src/lib/ai-gateway/providers/partner/providers.test.ts (deleted)
  • apps/web/src/lib/ai-gateway/providers/partner/providers.ts (deleted)
  • apps/web/src/lib/ai-gateway/providers/partner/routing.test.ts (deleted)
  • apps/web/src/lib/ai-gateway/providers/partner/routing.ts (deleted)
  • apps/web/src/lib/ai-gateway/providers/provider-definitions.test.ts
  • apps/web/src/lib/ai-gateway/providers/routing-config.ts
  • apps/web/src/lib/ai-gateway/providers/routing-percentage.ts
  • apps/web/src/lib/ai-gateway/providers/types.ts
  • apps/web/src/lib/ai-gateway/providers/vercel/index.test.ts
  • apps/web/src/lib/ai-gateway/rewriteModelResponse.test.ts
  • apps/web/src/lib/ai-gateway/rewriteModelResponse.ts
  • apps/web/src/routers/admin/gateway-config-router.ts

Verification Notes

  • No remaining references to PERPLEXITY_KIMI_PUBLIC_ID, PERPLEXITY_KIMI_PROVIDER, partnerPricingByModelId, getPercentageRoutedPartnerProvider, PercentageRoutedPartnerInput, RoutingCohort, perplexity_routing_percentage, or DEFAULT_PERPLEXITY_PERCENTAGE anywhere in apps, packages, or services.
  • KIMI_CURRENT_MODEL_ID resolves to moonshotai/kimi-k3, the same value as the deleted PERPLEXITY_KIMI_PUBLIC_ID, so the thinking-default behavior in apply-provider-specific-logic.ts:223 is unchanged.
  • CustomPricing.fallbackOnly had no remaining producers after partner pricing was deleted, so the simplified checks in custom-pricing.ts and rewriteModelResponse.ts:937 are behavior-preserving. processUsage.ts:1207 reads the separate KiloExclusivePricing.fallbackOnly, unaffected by this change.
  • Removed after(...), clone(), and body.cancel() fallback code does not introduce memory leaks; after and GatewayRequest remain used elsewhere in route.ts.
  • PERPLEXITY_API_KEY had no remaining code or dotenv references, so the ENVIRONMENT.md removal is consistent, while BYOK, embedding, and web-search Perplexity usages are unrelated and retained.

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

Review guidance: REVIEW.md from base branch main

chrarnoldus and others added 4 commits September 16, 2026 00:08
…tner-provider

# Conflicts:
#	apps/web/src/lib/ai-gateway/custom-pricing.ts
#	apps/web/src/lib/ai-gateway/providers/apply-provider-specific-logic.test.ts
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
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