fix: warn instead of blocking when configured model not in hardcoded list#7692
Merged
zouyonghe merged 3 commits intoAstrBotDevs:masterfrom Apr 21, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.
Member
|
@sourcery-ai review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复内容
将 MiniMax Token Plan Provider 中,不在硬编码白名单里的模型从
ValueError强行阻断改为logger.warning警告。原因: Plus 用户(如 MiniMax-M2.7-highspeed)被硬编码白名单阻断无法使用,但实际上 Plus plan 确实支持这些模型。
改动:
raise ValueErrorlogger.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:
Enhancements: