Fix/subscription base group ratio - #6312
Conversation
# Conflicts: # .gitignore # web/bun.lock # web/default/src/features/home/index.tsx
# Conflicts: # web/default/src/i18n/locales/zh-TW.json
# Conflicts: # web/default/src/features/dashboard/components/models/log-stat-cards.tsx # web/default/src/features/dashboard/index.tsx # web/default/src/features/home/index.tsx
Allow plans to limit which UsingGroup requests deduct subscription quota; empty allowed_groups keeps all groups eligible, otherwise unmatched requests fall back to wallet.
feat: scope subscription quota deduction to allowed groups
Record mapped user-facing status/message in error logs without mutating the original error used for retry and auto-disable decisions.
Subscription funding should charge at model base cost (group ratio 1) so group markup does not over-drain the subscription pool. Bump VERSION to 20260719.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (63)
WalkthroughThis PR adds configurable upstream status-code response mappings, group-scoped subscription billing, cache-token analytics, a home notice dialog, and related API, UI, localization, persistence, and build configuration updates. ChangesStatus-code response mapping
Group-scoped subscription billing
Cache analytics
Home notices and supporting configuration
Estimated code review effort: 5 (Critical) | ~120 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant ChannelContext
participant Relay
participant StatusMapping
Client->>ChannelContext: Send request through selected channel
ChannelContext->>Relay: Provide channel response mapping
Relay->>StatusMapping: Apply mapping to upstream error
StatusMapping-->>Relay: Return mapped response fields
Relay-->>Client: Emit mapped error response
sequenceDiagram
participant Dashboard
participant CacheStatsAPI
participant LogAggregation
Dashboard->>CacheStatsAPI: Request model cache statistics
CacheStatsAPI->>LogAggregation: Aggregate consumption logs
LogAggregation-->>CacheStatsAPI: Return cache tokens and hit rates
CacheStatsAPI-->>Dashboard: Return model statistics
Possibly related PRs
Suggested reviewers: Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Warning |
Important
📝 变更描述 / Description
订阅计费时不应再叠乘分组倍率,否则高分组(如 vip=2)会加速消耗订阅额度,相当于多扣。
修复:
preConsume / groupRatioPriceData、阶梯计费 snapshot,保证结算/日志一致VERSION:20260718→20260719未改: 钱包计费仍使用正常分组倍率。
🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
TestAdjustQuotaToSubscriptionBaseRate、TestApplyAndRestoreSubscriptionBaseGroupRatio通过;go build ./service通过。📸 运行证明 / Proof of Work