Skip to content

fix: unify model provider detection and add Wan icon - #7373

Merged
seefs001 merged 1 commit into
QuantumNous:mainfrom
seefs001:fix/codex-auto-review-icon
Sep 14, 2026
Merged

seefs001 merged 1 commit into
QuantumNous:mainfrom
seefs001:fix/codex-auto-review-icon

Conversation

@seefs001

@seefs001 seefs001 commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

⚠️ 提交说明 / PR Notice

English template: .github/PULL_REQUEST_TEMPLATE/en.md

Important

  • 描述可用 AI 辅助。提交前请审阅全文,并声明对其负责,避免未经核对的直接粘贴。
  • 请按本模板填写后再提交。

🔗 关联任务 / Related Issue

  • 新功能请填写下方 Issue 编号;若还没有对应 Issue,请先自行创建。功能讨论请放在 Issue 中进行。

  • 改动较大或方向性变更,请先在关联 Issue 中与维护者达成一致,再提交 PR。

  • Bug 修复请关联对应 Issue。设计取舍、理解偏差或预期不一致,更适合作为讨论或功能请求。

  • Closes [Bug] 使用日志中的 codex-* 模型未显示 OpenAI 图标 #7363

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix)
  • ✨ 新功能 (New feature)
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📝 文档更新 (Documentation)

📝 变更描述 / Description

(简述做了什么、为什么生效。如果难以简述,建议先拆分范围,或在 Issue 中与维护者对齐。)

统一供应商图标提取逻辑,补wan视频生成模型图标

📸 运行证明 / Proof of Work

(请写明如何验证:实际步骤与观察结果。UI 变更请附截图或录屏;Bug 修复请说明复现过程与修复后结果。)

✅ 提交前检查项 / Checklist

  • 人工确认: 无论描述是否由 AI 生成,我已审阅全部内容,并声明对其准确性与完整性负责。
  • 非重复提交: 我已搜索现有的 Issues 与 PRs,确认不是重复提交。
  • 新功能关联 Issue: 若此 PR 标记为 New feature,我已关联对应 Issue;若尚无 Issue,我已先自行创建。
  • 事前沟通: 若改动较大或涉及方向性变更,已在关联 Issue 中与维护者沟通并达成一致。
  • 功能范围: 本 PR 不是 Coding Plan、逆向渠道、第三方封装接口,也不是对 Codex 渠道类型的改动。
  • 范围聚焦: 本 PR 为一项聚焦改动,未包含无关代码。
  • 本地验证: 已在本地运行并通过测试或手动验证,维护者可以据此复核。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

Summary by CodeRabbit

  • New Features

    • Added Wan branding support, including its icon in model badges and icon selectors.
    • Expanded model provider recognition across a broad range of providers.
    • Model badges now display the appropriate provider icon and accessible labels.
    • Unknown models continue to use a clear “Other” fallback indicator.
  • Bug Fixes

    • Improved consistency between model categorization and provider icons.
    • Preserved model ordering and grouping when categorizing usage data.

@seefs001
seefs001 merged commit d926120 into QuantumNous:main Sep 14, 2026
2 of 3 checks passed
@coderabbitai

coderabbitai Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 83214c26-8a16-4650-86aa-896d29886a61

📥 Commits

Reviewing files that changed from the base of the PR and between 815217b and d90e466.

⛔ Files ignored due to path filters (1)
  • web/src/assets/custom/wan.png is excluded by !**/*.png
📒 Files selected for processing (6)
  • web/src/assets/custom/icon-wan.tsx
  • web/src/features/channels/lib/model-categories.ts
  • web/src/features/usage-logs/components/__tests__/model-badge.test.tsx
  • web/src/features/usage-logs/components/model-badge.tsx
  • web/src/lib/lobe-icon.tsx
  • web/src/lib/model-provider.ts

Walkthrough

The pull request adds a shared model-provider resolver with ordered rules, updates channel categories and usage-log badges to use it, adds the Wan icon, and introduces tests for provider classification, fallback rendering, grouping, and icon registration.

Changes

Model provider resolution

Layer / File(s) Summary
Provider catalog and resolver
web/src/lib/model-provider.ts, web/src/assets/custom/icon-wan.tsx, web/src/lib/lobe-icon.tsx
Adds shared provider types, ordered matching rules, the resolveModelProvider function, and the Wan icon registry entry.
Category and badge integration
web/src/features/channels/lib/model-categories.ts, web/src/features/usage-logs/components/model-badge.tsx
Replaces local provider matching with the shared resolver. Badge rendering now checks for an available provider icon and falls back to the provider name for accessibility text.
Provider classification and rendering tests
web/src/features/usage-logs/components/__tests__/model-badge.test.tsx
Adds coverage for provider variants, unknown models, grouping order, inspection rendering, and Wan icon registration.

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

Change: Bug fix · Severity of issue fixed: Medium

✨ 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

A rabbit reads each line,
The patch grows clear beneath the moon,
Small changes hop in place,
Tests guard the garden path,
Reviews bloom before the dawn.

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

stonegr pushed a commit to stonegr/new-api that referenced this pull request Sep 14, 2026
Javabcd pushed a commit to Javabcd/new-api that referenced this pull request Sep 16, 2026
kimberxu pushed a commit to kimberxu/new-api that referenced this pull request Sep 16, 2026
GuDong2003 pushed a commit to GuDong2003/new-api that referenced this pull request Sep 25, 2026
TomJKS pushed a commit to TomJKS/new-api that referenced this pull request Sep 28, 2026
timwenx pushed a commit to timwenx/new-api that referenced this pull request Nov 18, 2026
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.

[Bug] 使用日志中的 codex-* 模型未显示 OpenAI 图标

1 participant