You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[AISAGE-707] chore(ai-gateway): remove the in-code custom pricing fallback - #9003
Custom pricing now lives in ai_gateway_config.custom_pricing, so the hardcoded CUSTOM_PRICING_FALLBACK_CONFIG (the Gemini 3.8 Flash and Gemini 4 Argon discounts) is removed.
When no config is stored, or the first read fails, the gateway applies no custom pricing (EMPTY_CUSTOM_PRICING_CONFIG). This matches how preferred provider order handles an unset value. If a read fails after a successful one, the cached getter still serves the last valid value.
The admin Custom Pricing screen and admin.customPricing.get no longer return or show in-code defaults. An unset config opens the editor with { "models": [] }.
The Providers & Models page shows list prices until the stored config loads.
Tests that relied on the fallback now use a TEST_CUSTOM_PRICING_CONFIG fixture in packages/web-shared/src/tests/helpers/custom-pricing.helper.ts.
Verification
pnpm --filter @kilocode/web-shared typecheck and pnpm --filter web typecheck
Reviewed all 18 files in the removal of the in-code custom pricing fallback; the new EMPTY_CUSTOM_PRICING_CONFIG default, the dropped fallback field on admin.customPricing.get, the useCustomPricingConfig fallback, and the migrated test fixture are internally consistent and keep the existing createCachedFetch last-known-good semantics.
Assumptions:[INFERENCE] The Gemini promotional pricing now depends entirely on ai_gateway_config.custom_pricing being populated in each deployed environment; the repository contains only the column migration (0309_good_silk_fever.sql) and no seed, so the stored config must already exist before this deploys, otherwise those models bill and display at list price and a single failed first read (cold instance, replica unavailable) also bills list price until the retry succeeds. [INFERENCE] I did not execute the Jest suites or typecheck and relied on the PR's stated verification.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Custom pricing now lives in
ai_gateway_config.custom_pricing, so the hardcodedCUSTOM_PRICING_FALLBACK_CONFIG(the Gemini 3.8 Flash and Gemini 4 Argon discounts) is removed.EMPTY_CUSTOM_PRICING_CONFIG). This matches how preferred provider order handles an unset value. If a read fails after a successful one, the cached getter still serves the last valid value.admin.customPricing.getno longer return or show in-code defaults. An unset config opens the editor with{ "models": [] }.TEST_CUSTOM_PRICING_CONFIGfixture inpackages/web-shared/src/tests/helpers/custom-pricing.helper.ts.Verification
pnpm --filter @kilocode/web-shared typecheckandpnpm --filter web typecheckoxlinton the changed filespackages/web-shared/src/lib/ai-gateway/,apps/web/src/components/organizations/providers-and-models,apps/web/src/lib/agent-briefing/summary.test.ts,apps/web/src/routers/admin/custom-pricing-router.test.ts(all pass)Models used: Claude Opus 5.5 (
kilo/anthropic/claude-opus-5.5). No subagents were used.