From 406bb6c1a768b93c63a9bc89c4f4cf3ddf3c853f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=83=E5=B2=9A=E4=B9=8B=E5=A4=8F?= <108566281+Blueteemo@users.noreply.github.com> Date: Tue, 21 Apr 2026 08:24:18 +0800 Subject: [PATCH] fix: warn instead of blocking when configured model not in hardcoded list (#7692) * fix: change highspeed model block to warning instead of ValueError * fix: add highspeed models + use astrbot logger (per AI review) * style: fix ruff format (line-length, import grouping) --- .../provider/sources/minimax_token_plan_source.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/astrbot/core/provider/sources/minimax_token_plan_source.py b/astrbot/core/provider/sources/minimax_token_plan_source.py index 5a578424f..d226707fd 100644 --- a/astrbot/core/provider/sources/minimax_token_plan_source.py +++ b/astrbot/core/provider/sources/minimax_token_plan_source.py @@ -1,11 +1,15 @@ +from astrbot import logger from astrbot.core.provider.sources.anthropic_source import ProviderAnthropic from ..register import register_provider_adapter MINIMAX_TOKEN_PLAN_MODELS = [ "MiniMax-M2.7", + "MiniMax-M2.7-highspeed", "MiniMax-M2.5", + "MiniMax-M2.5-highspeed", "MiniMax-M2.1", + "MiniMax-M2.1-highspeed", "MiniMax-M2", ] @@ -43,9 +47,13 @@ class ProviderMiniMaxTokenPlan(ProviderAnthropic): configured_model = provider_config.get("model", "MiniMax-M2.7") if configured_model not in MINIMAX_TOKEN_PLAN_MODELS: - raise ValueError( - f"Unsupported model: {configured_model!r}. " - f"Supported models: {', '.join(MINIMAX_TOKEN_PLAN_MODELS)}" + logger.warning( + f"Configured model {configured_model!r} is not in the known " + f"Token Plan model list " + f"({', '.join(MINIMAX_TOKEN_PLAN_MODELS)}). " + f"The model may still work if your plan supports it. " + f"If you encounter errors, please check your plan's " + f"model availability." ) self.set_model(configured_model)