Skip to content

feat: add unset price models tab to model pricing settings - #6124

Merged
Calcium-Ion merged 2 commits into
QuantumNous:mainfrom
feitianbubu:feat/unset-price-models-tab
Jul 11, 2026
Merged

feat: add unset price models tab to model pricing settings#6124
Calcium-Ion merged 2 commits into
QuantumNous:mainfrom
feitianbubu:feat/unset-price-models-tab

Conversation

@feitianbubu

@feitianbubu feitianbubu commented Jul 11, 2026

Copy link
Copy Markdown
Member

⚠️ 提交说明 / PR Notice

Important

  • 请提供人工撰写的简洁摘要,避免直接粘贴未经整理的 AI 输出。

📝 变更描述 / Description

v1 界面的模型定价一直没有旧版的「未设置价格模型」功能,新加的模型要切回旧界面才能快速定价

这个 PR 在 计费设置 → 模型定价 下加回了这个 tab

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix) - 请关联对应 Issue,避免将设计取舍、理解偏差或预期不一致直接归类为 bug
  • ✨ 新功能 (New feature) - 重大特性建议先通过 Issue 沟通
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📝 文档更新 (Documentation)

🔗 关联任务 / Related Issue

✅ 提交前检查项 / Checklist

  • 人工确认: 我已亲自整理并撰写此描述,没有直接粘贴未经处理的 AI 输出。
  • 非重复提交: 我已搜索现有的 IssuesPRs,确认不是重复提交。
  • Bug fix 说明: 若此 PR 标记为 Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。
  • 变更理解: 我已理解这些更改的工作原理及可能影响。
  • 范围聚焦: 本 PR 未包含任何与当前任务无关的代码改动。
  • 本地验证: 已在本地运行并通过测试或手动验证,维护者可以据此复核结果。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

📸 运行证明 / Proof of Work

未设置价格模型中设置价格
image
image

添加成功
image

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Adds an unset-models tab to model pricing. It detects missing base prices, fetches enabled models for filtering, restricts unset-mode actions, commits drafts before batch copying, and adds translations for the new tab and empty state.

Changes

Unset model pricing

Layer / File(s) Summary
Pricing detection and model filtering
web/default/src/features/system-settings/models/model-pricing-snapshots.ts, web/default/src/features/system-settings/models/model-ratio-visual-editor.tsx
Adds isBasePricingUnset and uses it to identify and display models without base pricing.
Unset pricing tab wiring
web/default/src/features/system-settings/models/ratio-settings-card.tsx, web/default/src/features/system-settings/models/model-ratio-form.tsx, web/default/src/features/system-settings/billing/section-registry.tsx, web/default/src/i18n/locales/*
Adds the unset-models tab, enabled-model lookup, unset form variant, conditional controls, and localized labels.
Unset editor actions and state handling
web/default/src/features/system-settings/models/model-ratio-table-columns.tsx, web/default/src/features/system-settings/models/model-ratio-visual-editor.tsx
Disables deletion and add-model actions in unset mode, commits open drafts before batch copy, and updates table, empty-state, and memoization behavior.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RatioSettingsCard
  participant ModelRatioForm
  participant getEnabledModels
  participant ModelRatioVisualEditor
  RatioSettingsCard->>ModelRatioForm: render unset-models variant
  ModelRatioForm->>getEnabledModels: fetch enabled model names
  getEnabledModels-->>ModelRatioForm: return candidate names
  ModelRatioForm->>ModelRatioVisualEditor: apply unset filter and candidates
Loading

Possibly related PRs

Suggested reviewers: seefs001, Calcium-Ion

Poem

I’m a rabbit with prices to set,
Finding blank models in the net.
New tabs bloom bright,
Drafts commit right,
And translated labels won’t forget!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes restore the unset price models workflow in v1 model pricing, matching issue #5779's goal.
Out of Scope Changes check ✅ Passed No clearly unrelated changes appear; the editor, tab, and locale updates all support the unset price models feature.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding an Unset Price Models tab to model pricing settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Calcium-Ion
Calcium-Ion merged commit 8283df1 into QuantumNous:main Jul 11, 2026
2 checks passed
agogo233 added a commit to agogo233/new-api that referenced this pull request Jul 13, 2026
* upstream/main: (56 commits)
  fix: list only channel models in unset price models tab
  fix: harden unset price models tab batch copy, feedback, and memo equality
  feat: add unset price models tab to model pricing settings (QuantumNous#6124)
  feat: enhance model search functionality with status and sync filters
  fix: bound uncached remainder by prompt-max(cached,write) and forward compact prompt_cache_key
  feat: bill OpenAI cache_write_tokens at cache-creation price with zero clamp
  feat: enhance text protocol conversion and advanced custom routing (QuantumNous#5825)
  fix: adjust margin for StatusBadge component in logs columns
  feat: enhance stale instance handling and update theme colors
  feat: update theme colors
  feat(timing): add timing metrics display for stream logs and enhance localization
  revert: restore StatusBadge horizontal padding
  revert: undo t0ng7u UI design-system refactor
  ✨ feat(web): polish themed data views and add task log details
  feat(image): enhance image stream handling with client disconnect logic and billing adjustments
  fix(billing): improve quota handling and error reporting for pre-consume operations
  fix(billing): reject saturated pre-consume quota
  🐛 fix: Fontsource asset resolution across workspace layouts
  fix: sync codex field (QuantumNous#6018)
  chore(deps): bump golang.org/x/crypto from 0.51.0 to 0.52.0 (QuantumNous#6096)
  ...
lizhongyi1209 pushed a commit to lizhongyi1209/new-api that referenced this pull request Jul 13, 2026
…us#6124)

* feat: add unset price models tab to model pricing settings

* feat: add unset price models tab translations

(cherry picked from commit 8283df1)
lansine pushed a commit to evin-pubb/new-api-fork that referenced this pull request Jul 14, 2026
…us#6124)

* feat: add unset price models tab to model pricing settings

* feat: add unset price models tab translations
zhaodechao2008 pushed a commit to zhaodechao2008/new-api that referenced this pull request Jul 27, 2026
…us#6124)

* feat: add unset price models tab to model pricing settings

* feat: add unset price models tab translations
330079598 pushed a commit to 330079598/new-api that referenced this pull request Aug 19, 2026
…us#6124)

* feat: add unset price models tab to model pricing settings

* feat: add unset price models tab translations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v1 版本中模型定价中缺少未设置价格模型功能

2 participants