fix(llm): gate MiniMax reasoning_split by model capability (#826)
MinimaxChatOpenAI unconditionally set reasoning_split=True, but the kwarg is only valid on M2.x reasoning models. The openai SDK's strict kwarg validation raised TypeError for Coding Plan and any other non- reasoning MiniMax model. Adds requires_reasoning_split to ModelCapabilities, gates the payload injection on it, and only sets True for _MINIMAX_THINKING (M2.x exact IDs and the ^MiniMax-M\d forward-compat pattern). Same shape as the existing supports_tool_choice gate. Regression tests cover both halves: M2.x models still receive the flag, non-reasoning MiniMax models do not.
This commit is contained in:
1 parent
3e5e99b368
commit
e848b5e812
4 files changed
+42
-1
No files matched your search
@@ -38,6 +38,12 @@ class ModelCapabilities:
|
||||
# DeepSeek thinking-mode models 400 if reasoning_content from prior
|
||||
# assistant turns is not echoed back on the next request.
|
||||
requires_reasoning_content_roundtrip: bool = False
|
||||
# MiniMax M2.x reasoning models need ``reasoning_split=True`` so the
|
||||
# <think> block lands in ``reasoning_details`` instead of polluting
|
||||
# ``content``. The flag is rejected by non-reasoning MiniMax models
|
||||
# (Coding Plan, MiniMax-Text-01, etc.), so we only set it where the
|
||||
# model actually consumes it. (#826)
|
||||
requires_reasoning_split: bool = False
|
||||
|
||||
|
||||
# DeepSeek's thinking models accept the ``tools`` array but reject the
|
||||
@@ -74,6 +80,7 @@ _MINIMAX_THINKING = ModelCapabilities(
|
||||
supports_json_mode=False,
|
||||
supports_json_schema=False,
|
||||
preferred_structured_method="function_calling",
|
||||
requires_reasoning_split=True,
|
||||
)
|
||||
|
||||
_DEFAULT = ModelCapabilities(
|
||||
|
||||
Reference in new issue
Block a user