Skip to content

fix: warn instead of blocking when configured model not in hardcoded list#7692

Merged
zouyonghe merged 3 commits intoAstrBotDevs:masterfrom
Blueteemo:fix/highspeed-warning-instead-of-error
Apr 21, 2026
Merged

fix: warn instead of blocking when configured model not in hardcoded list#7692
zouyonghe merged 3 commits intoAstrBotDevs:masterfrom
Blueteemo:fix/highspeed-warning-instead-of-error

Conversation

@Blueteemo
Copy link
Copy Markdown
Contributor

@Blueteemo Blueteemo commented Apr 20, 2026

修复内容

将 MiniMax Token Plan Provider 中,不在硬编码白名单里的模型从 ValueError 强行阻断改为 logger.warning 警告。

原因: Plus 用户(如 MiniMax-M2.7-highspeed)被硬编码白名单阻断无法使用,但实际上 Plus plan 确实支持这些模型。

改动:

  • 移除 raise ValueError
  • 改为 logger.warning 提示用户模型可能不受支持,但仍允许配置

背景

由用户反馈驱动:#7609 (comment)

Summary by Sourcery

Allow MiniMax token plan to accept configured models outside the hardcoded list while logging a warning instead of blocking.

Bug Fixes:

  • Permit Plus users to use additional MiniMax models that were previously blocked by a hardcoded whitelist despite being supported by their plan.

Enhancements:

  • Extend the known MiniMax token plan model list to include additional highspeed variants for better default compatibility.

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Apr 20, 2026
@auto-assign auto-assign bot requested review from advent259141 and anka-afk April 20, 2026 13:41
@dosubot dosubot bot added the area:provider The bug / feature is about AI Provider, Models, LLM Agent, LLM Agent Runner. label Apr 20, 2026
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the MiniMax token plan source to log a warning instead of raising an exception when an unrecognized model is used, allowing for greater flexibility. Feedback suggests using the centralized logger from the astrbot package for consistency and considering refactoring to minimize code duplication with similar providers.

Comment thread astrbot/core/provider/sources/minimax_token_plan_source.py Outdated
@zouyonghe
Copy link
Copy Markdown
Member

@sourcery-ai review

@zouyonghe zouyonghe merged commit 406bb6c into AstrBotDevs:master Apr 21, 2026
21 checks passed
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Blueteemo Blueteemo deleted the fix/highspeed-warning-instead-of-error branch April 21, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:provider The bug / feature is about AI Provider, Models, LLM Agent, LLM Agent Runner. size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants