fix: put the tier back where "on" by itself is not on
The minimax wire lost its tier value on the assumption that these models
reason by default, so injecting nothing still reads as "on". T10 measured
the real gateway and the assumption does not hold: MiniMax-M3 with no
reasoning parameter did not reason in 5 of 5 rounds, while all six
strength values worked. Existing downstreams on ENABLE_THINKING=true
went from reasoning to silently not reasoning, and the capability table
cannot catch it because phase 5 lets auto through unconditionally.
Restore on_base to the old {"reasoning_effort": "medium"} verbatim. This
is a stopgap - it hands the tier choice back to the library, which this
work set out to remove. The real fix is to constrain auto by the
capability table, a public behaviour change tracked as issue #21.
The assertions that said "minimax injects no tier on the on-tier" go
back with it; each carries a note on why it moved twice.
This commit is contained in:
@@ -258,10 +258,12 @@ class TestReasoningEffortPriority:
|
||||
async def test_legacy_on_tier_matches_old_fragment(self, provider, model, fragment):
|
||||
"""存量 `ENABLE_THINKING=true` 的回归门: 发出去的字节逐字不变。
|
||||
|
||||
**只覆盖 `on_base` 自己就说全了"开"的四段**。minimax/openai/anthropic/google
|
||||
的开档旧版硬编码 `{"reasoning_effort": "medium"}`,新版不注入任何档位——那是
|
||||
设计 §4.2 声明过的**有意变更**(medium 在 GLM/kimi/deepseek 的档位表里根本
|
||||
不存在,是库替下游做的档位判断),不是本门要守的不变量。
|
||||
**只覆盖 `on_base` 自己就说全了"开"的四段**。openai/anthropic/google 的开档
|
||||
旧版硬编码 `{"reasoning_effort": "medium"}`,新版不注入任何档位——那是设计
|
||||
§4.2 声明过的**有意变更**(medium 在 GLM/kimi/deepseek 的档位表里根本不存在,
|
||||
是库替下游做的档位判断),不是本门要守的不变量;这三家的模型经 OpenRouter
|
||||
登记均为默认推理,不注入也仍是"开"。minimax 不在此列: 它的模型不满足该前提,
|
||||
已按 issue #21 改回 medium,由下一条用例单独守。
|
||||
|
||||
qwen/deepseek 两条字面量逐字取自升级前的 `ProviderProfile.thinking_on`;
|
||||
zhipu/moonshot 升级前没有对应段,断言的是它们 2026-09-04 登记的形态。
|
||||
@@ -275,6 +277,23 @@ class TestReasoningEffortPriority:
|
||||
# `auto` = 开启但不指定强度: 语法糖不得替调用方挑一个档
|
||||
assert "reasoning_effort" not in body
|
||||
|
||||
async def test_legacy_minimax_on_tier_actually_turns_reasoning_on(self):
|
||||
"""回归门(issue #21): minimax 段的存量 `ENABLE_THINKING=true` 必须真开推理。
|
||||
|
||||
本次换代一度把这段的开启形态改成 `on_base={}`(什么参数都不注入),依据是
|
||||
"这些模型默认就推理,不注入也仍是'开'"。T10 真实网关实测推翻了该前提:
|
||||
MiniMax-M3 不带任何推理参数时 5/5 轮**不推理**(六个强度值则全部生效)。
|
||||
于是存量下游从"真开推理"静默变成"不推理",而 `resolve_thinking` 的 Phase 5
|
||||
无条件放行 `auto`、能力表也堵不住这条路。
|
||||
|
||||
断言落在**发出去的字节**上而非中间态: 静默不推理这件事只有在请求体里才看得见。
|
||||
"""
|
||||
captured = []
|
||||
source = _source(provider="minimax", model="MiniMax-M3", enable_thinking=True)
|
||||
async with self._capturing_client(captured, sources=[source]) as client:
|
||||
await client.chat([{"role": "user", "content": "hi"}])
|
||||
assert captured[0]["reasoning_effort"] == "medium"
|
||||
|
||||
|
||||
class TestEffortFallbackWiring:
|
||||
"""源级 `effort_fallback` 必须真的走到 `resolve_thinking`(issue #20)。
|
||||
|
||||
Reference in New Issue
Block a user