Skip to content

fix: support six-decimal steps in model pricing editor - #5332

Merged
t0ng7u merged 1 commit into
QuantumNous:mainfrom
yyhhyyyyyy:fix/model-pricing-six-decimal-step
Jun 6, 2026
Merged

fix: support six-decimal steps in model pricing editor#5332
t0ng7u merged 1 commit into
QuantumNous:mainfrom
yyhhyyyyyy:fix/model-pricing-six-decimal-step

Conversation

@yyhhyyyyyy

@yyhhyyyyyy yyhhyyyyyy commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

⚠️ 提交说明 / PR Notice

Important

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

📝 变更描述 / Description

(简述:做了什么?为什么这样改能生效?请基于你对代码逻辑的理解来写,避免粘贴未经整理的内容)
将模型定价表达式可视化编辑器中价格和倍率输入仅支持 2 位步进改成 6 位。

🚀 变更类型 / 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

(请在此粘贴截图、关键日志或测试报告,以证明变更生效)

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced precision in the tiered pricing editor's numeric input fields, enabling finer adjustments for token price and request rule group multiplier settings.

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d0fb25a7-b159-43fd-8dbb-b58e03709058

📥 Commits

Reviewing files that changed from the base of the PR and between 3280584 and e8c3676.

📒 Files selected for processing (1)
  • web/default/src/features/system-settings/models/tiered-pricing-editor.tsx

Walkthrough

The tiered pricing editor's numeric input controls are adjusted to support six-decimal-place precision. The tier token price input and rule group multiplier input now use a finer step value of 0.000001 instead of 0.01, enabling users to configure sub-cent pricing and granular discount multipliers without UI constraints.

Changes

Numeric Precision Enhancement

Layer / File(s) Summary
Numeric input step precision
web/default/src/features/system-settings/models/tiered-pricing-editor.tsx
Token price and rule group multiplier DraftNumberInput components now accept step={0.000001} instead of 0.01, enabling six-decimal-place precision for pricing configuration.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • QuantumNous/new-api#4536: Both PRs modify numeric input behavior in the tiered pricing editor; this PR fine-tunes numeric precision via the step prop, while the related PR introduced the DraftNumberInput component itself.

Poem

🐰 Six decimals dance with glee,
No more rounding tragedy!
Pricing now has clarity,
Discounts flow with parity. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding support for six-decimal step precision in the model pricing editor.
Linked Issues check ✅ Passed The PR correctly addresses issue #5329 by adjusting numeric input precision from 2 decimals to 6 decimals in the pricing editor, allowing consistency between visual and expression editors.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the numeric precision issue in the tiered pricing editor; no out-of-scope modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the 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 and usage tips.

@t0ng7u
t0ng7u merged commit 4ca47ee into QuantumNous:main Jun 6, 2026
2 checks passed
OuYang-HX pushed a commit to OuYang-HX/new-api that referenced this pull request Jun 13, 2026
)

Merge pull request QuantumNous#5332 from yyhhyyyyyy/fix/model-pricing-six-decimal-step
YeMao11 pushed a commit to YeMao11/new-api that referenced this pull request Jun 16, 2026
Upstream changes (50+ commits, v1.0.0-rc.11):
- data-table perf: row selection memo, column pinning, badge display
- Fixes: channel test dialog (QuantumNous#5517), CC Switch model selector (QuantumNous#5515),
  API key form options (QuantumNous#5512), cell overflow (QuantumNous#5510), kimi k2.6 temp (QuantumNous#5390),
  Anthropic-compatible GLM chunked encoding (QuantumNous#5307), streaming image relay (QuantumNous#4608)
- Feat: audit auth method tracking (QuantumNous#5462), channel affinity clear toggle (QuantumNous#5306),
  relay idle timeout config (QuantumNous#5309), 6-decimal pricing precision (QuantumNous#5332)
- Classic frontend: Rsbuild support, Semi React 19 adapter
- Shared dialog wrapper, JSON code editor, debounce channel search

Conflict resolved: web/bun.lock (accepted upstream, will regenerate)

Co-Authored-By: Claude <noreply@anthropic.com>
YeMao11 pushed a commit to YeMao11/new-api that referenced this pull request Jun 16, 2026
Merge upstream v1.0.0-rc.11 (50+ commits):
- data-table perf: row selection memo, column pinning, badge display
- Fixes: channel test dialog (QuantumNous#5517), CC Switch (QuantumNous#5515), API key (QuantumNous#5512),
  kimi k2.6 temp (QuantumNous#5390), GLM chunked encoding (QuantumNous#5307), streaming image (QuantumNous#4608)
- Feat: audit auth tracking (QuantumNous#5462), channel affinity toggle (QuantumNous#5306),
  relay idle timeout (QuantumNous#5309), 6-decimal pricing (QuantumNous#5332)
- Shared dialog wrapper, JSON code editor, classic Rsbuild support

SEO optimization:
- robots.txt: 10 AI crawler blocks + 22 path disallows + crawl-delay
- sitemap.xml: 7 public URLs with 6-language hreflang annotations
- index.html: hreflang tags, og:locale:alternate, og:image, canonical,
  5 structured data types (Organization, SoftwareApplication, FAQPage,
  WebSite, SearchAction), expanded keywords (gateway, agent router,
  aggregation, orchestration)
- i18n/config.ts: sync <html lang> with active language for SEO

Co-Authored-By: Claude <noreply@anthropic.com>
noah-wung pushed a commit to noah-wung/new-api that referenced this pull request Jul 17, 2026
)

Merge pull request QuantumNous#5332 from yyhhyyyyyy/fix/model-pricing-six-decimal-step
zhaodechao2008 pushed a commit to zhaodechao2008/new-api that referenced this pull request Jul 27, 2026
)

Merge pull request QuantumNous#5332 from yyhhyyyyyy/fix/model-pricing-six-decimal-step
330079598 pushed a commit to 330079598/new-api that referenced this pull request Aug 19, 2026
)

Merge pull request QuantumNous#5332 from yyhhyyyyyy/fix/model-pricing-six-decimal-step
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.

新UI在模型定价位置的数字精度不一致

2 participants