Repository navigation
fix(pricing): accept the dsh provider in PricingProviderSchema - #1652
Conversation
PricingProviderSchema (src/types.ts) forgot dsh when it was added to
ProviderNameSchema, so POST /api/pricing/dsh/{model}/{tokenClass} 400ed
and a dsh session-cost POST was rejected by the same inline enum in
src/http/session-data.ts — an operator could not record a dsh price row
or have dsh usage costed at all.
Add dsh to PricingProviderSchema (acp sets the precedent for accepting
a provider without seeded rate rows) and have session-data.ts's
provider field on POST /api/session-costs import and reuse that schema
instead of hand-duplicating the enum, so the two lists can't drift
again. Also add the now-required dsh entry to pricing-normalize.ts's
per-provider Record (no-op, same as claude/devin/gemini). Regenerate
openapi.json and docs-site/public/openapi.d.ts.
Closes desplega-ai#1636
|
@drakeo338 is attempting to deploy a commit to the Desplega Labs Team on Vercel. A member of the Team first needs to authorize it. |
|
Verdict: changes needed for CI; the API fix is sound. Reviewed full diff StandardsNo introduced code-quality findings. Reusing Specification
Required CI follow-up
The live main-branch rules require |
Intent
Fixes #1636.
dshwas added toProviderNameSchemabut never toPricingProviderSchema, soPOST /api/pricing/dsh/{model}/{tokenClass}returns 400 and adshsession-cost row is rejected the same wayacpwas before it got added.Repro
origin/main, run:bun -e 'import {ProviderNameSchema, PricingProviderSchema} from "./src/types"; console.log(PricingProviderSchema.safeParse("dsh").success)'.false;ProviderNameSchemaacceptsdshbutPricingProviderSchemadoes not.Setup
bd6074f, fix on top atf533328.Decisions & trade-offs
Made
session-data.ts'sPOST /api/session-costsprovider field reusePricingProviderSchemainstead of its own inline enum, so the two lists cannot drift apart again. No other side effects: no migration, no new config.Proof of work
bun test src/tests/pricing-routes.test.ts src/tests/provider-registration.test.tson merge-basebd6074f(upstream/main) with this PR's test files overlaid: 21 passed, 2 failed (the two newdshassertions).f533328(this branch's HEAD): 23 passed, 0 failed.Urgency