Default built-in pricing to CNY / 默认内置计费使用人民币#4462
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a2b4e01581
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if e.Prices[model] == nil { | ||
| e.Prices[model] = clonePricing(price) |
There was a problem hiding this comment.
Preserve explicit MiMo price fallback
When an existing official MiMo provider has a provider-wide price fallback but no per-model prices (for example a user configured overseas USD/custom rates), this backfill adds CNY defaults for the curated models. PriceForModel prefers Prices[model] over Price, so after mergeCuratedModelsIntoProvider those new entries silently shadow the user's explicit pricing for mimo-v2.5-pro/mimo-v2.5/mimo-v2-omni; skip this backfill or seed from the existing fallback when e.Price is already set.
Useful? React with 👍 / 👎.
| func deepSeekV4FlashPrice() *provider.Pricing { | ||
| return &provider.Pricing{CacheHit: 0.0028, Input: 0.14, Output: 0.28, Currency: "$"} | ||
| return &provider.Pricing{CacheHit: 0.02, Input: 1, Output: 2, Currency: "¥"} |
There was a problem hiding this comment.
Stop reporting CNY amounts as USD
Changing the default DeepSeek price currency to ¥ makes the default model's Pricing.Cost return yuan, but the desktop and serve wire paths still copy that raw value into the deprecated costUsd/sessionCostUsd fields without any conversion. Any client or saved telemetry that still reads those compatibility fields for the default DeepSeek model will now receive a CNY amount labeled as USD; either avoid populating the USD alias for non-USD prices or convert it before setting those fields.
Useful? React with 👍 / 👎.
| func mimoV2FlashPrice() *provider.Pricing { | ||
| return &provider.Pricing{CacheHit: 0.07, Input: 0.70, Output: 2.10, Currency: "¥"} |
There was a problem hiding this comment.
Use V2.5 pricing for rerouted v2-flash
For configurations that still include mimo-v2-flash, this helper continues to price it at the legacy V2 Flash rates even though MiMo's pricing page says the model auto-routes to V2.5 pricing on 2026-06-18 (https://mimo.mi.com/docs/en-US/price/pay-as-you-go). After that date cost estimates for copied examples or fetched/backfilled v2-flash models will mix stale rates, e.g. input miss ¥0.70 instead of ¥1.00, so map the alias to mimoV25Price() once the reroute is in effect or avoid hardcoding the expiring rate.
Useful? React with 👍 / 👎.
|
Superseded by #4329. The default CNY pricing behavior for official DeepSeek/MiMo providers has been folded into that integration PR while preserving explicit custom pricing. |
Pull request was closed
Summary
Verification
go test ./internal/provider ./internal/config(cd desktop && go test ./...)(cd desktop/frontend && npm run typecheck && npm exec -- tsx src/__tests__/context-panel-breakdown.test.ts)git diff --check