feat(coding-plans): add MiniMax token tiers#4269
Conversation
| @@ -0,0 +1 @@ | |||
| CREATE UNIQUE INDEX "UQ_coding_plan_sub_live_user_provider" ON "coding_plan_subscriptions" USING btree ("user_id","provider_id") WHERE "coding_plan_subscriptions"."status" IN ('active', 'past_due'); No newline at end of file | |||
There was a problem hiding this comment.
WARNING: Unique index migration will block writes on a populated table
CREATE UNIQUE INDEX takes a table lock that blocks writes while the index is built. Because coding_plan_subscriptions can already contain production rows, this migration should use a concurrent index build (and the matching non-transactional migration pattern) before it ships.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
|
|
||
| const entries = rawEntries.map(parseInventoryCredentialEntry); | ||
| const validateCredential = options.validateCredential ?? validateTokenPlanPlusCredential; | ||
| const validateCredential = options.validateCredential ?? validateMiniMaxCodingPlanCredential; |
There was a problem hiding this comment.
WARNING: Tier validation is still provider-only
This new multi-tier upload path never passes the selected planId or upstreamPlanId into validation, so any working MiniMax key can be stored under Plus, Max, or Ultra. A mislabeled upload would then sell the wrong tier and assign the wrong upstream entitlement to subscribers. Please make the validator prove compatibility with the selected plan before the row becomes available.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review SummaryStatus: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (23 files)
Fix these issues in Kilo Cloud Reviewed by gpt-5.4-20260305 · Input: 202.5K · Output: 23.7K · Cached: 2.1M Review guidance: REVIEW.md from base branch |
Summary
minimaxand catalog feature metadata.(user_id, provider_id)foractiveorpast_duerows.Verification
Visual Changes
No screenshots captured. UI changes are limited to existing Subscription Center and admin Coding Plans surfaces:
Reviewer Notes
Local validation guide
Start local dependencies and apply migrations:
docker compose -f dev/docker-compose.yml ps postgrespnpm test:db.UQ_coding_plan_sub_live_user_provideron(user_id, provider_id)foractiveandpast_due.Run the targeted automated checks:
pnpm --filter web test -- apps/web/src/lib/coding-plans/index.test.ts apps/web/src/routers/coding-plans-router.test.ts apps/web/src/lib/coding-plans/billing-lifecycle-cron.test.ts apps/web/src/components/subscriptions/helpers.test.ts apps/web/src/routers/byok-router.test.ts packages/db/src/schema.test.tspnpm --filter @kilocode/db typecheckpnpm --filter web typecheckscripts/typecheck-all.sh --changes-onlypnpm formatValidate catalog and pricing behavior:
minimax-token-plan-plus,minimax-token-plan-max, andminimax-token-plan-ultra.providerId: "minimax".$20 /month,$50 /month, and$120 /month.~1.7Band3-4,~5.1Band4-5,~12.5Band6-7.Validate purchase and exclusivity behavior:
Validate BYOK blocking behavior:
Validate Admin UI upload behavior:
pnpm dev:start./admin/coding-plansas an admin.minimaxand Plan offers Plus, Max, and Ultra filtered by provider.<api key>::<upstream plan id>.Validate user UI behavior:
/subscriptions#coding-plans.Validate renewal billing:
50_000_000microdollars and descriptionCoding plan renewal: MiniMax Token Plan Max.120_000_000microdollars.Checks run in this session
pnpm formatpnpm --filter web test -- apps/web/src/components/subscriptions/helpers.test.ts apps/web/src/lib/coding-plans/inventory-validation.test.ts --runInBandpnpm --filter @kilocode/db typecheckpnpm --filter web typecheckscripts/typecheck-all.sh --changes-onlygit diff --checkNot run here
docker compose -f dev/docker-compose.yml ps postgresandpnpm test:dbfailed to connect to the Docker socket.Implementation notes
provider_idis the exclusivity key; this branch does not addexclusive_group_id.(user_id, plan_id)partial unique index remains because Drizzle generated only the new provider-level index..plans/minimax-token-plan-tiers.mdis saved locally as requested, but.plans/*is ignored by the repo and was not force-added.