test: give two silent guards something to fail on again
`test_extra_body_overrides_the_profile_slot` guards that a source's `extra_body` wins over the slot the profile injects. Since T5 made `enable_thinking=True` mean `auto`, its minimax fixture injected an empty fragment — swapping the two update calls changed nothing and the whole suite stayed green, while a real source (zhipu, glm-5.3, tier `low`) would have shipped `low` instead of the `high` the caller wrote. Move the fixture onto that combination, where the two sides write the same key. `emit_attempt`'s docstring promises `reasoning_applies` carries no default so that a missed argument is a TypeError rather than a silent `True`; nothing enforced it. Pin the signature the way `record_llm_call` is already pinned.
This commit is contained in:
@@ -1421,6 +1421,21 @@ class TestEmitterReasoningEffort:
|
||||
)
|
||||
assert rec.rows[0]["reasoning_effort"] is None
|
||||
|
||||
def test_reasoning_applies_has_no_default(self):
|
||||
"""上一条测的是"传了 False 会怎样",这条测的是"**漏传**会怎样"。
|
||||
|
||||
`reasoning_applies` 的约定是不设默认值(与 `TelemetryRecorder` 同款):库外
|
||||
无第三方调用者,写全签名成本为零,而默认 `True` 会让将来新增的第四条 emit
|
||||
路径(又一个非推理客户端)漏传时静默落进 chat 口径——一次 embedding 失败被
|
||||
挂上源上误配的 `auto` 档,正是上一条测试要防的形态,却绕过了它的断言。
|
||||
约定只写在 docstring 里是没有执法点的,故在此以 `inspect.signature` 实测。
|
||||
"""
|
||||
import inspect
|
||||
|
||||
param = inspect.signature(TelemetryEmitter.emit_attempt).parameters["reasoning_applies"]
|
||||
assert param.default is inspect.Parameter.empty
|
||||
assert param.kind is inspect.Parameter.KEYWORD_ONLY
|
||||
|
||||
async def test_an_out_of_domain_tier_degrades_but_keeps_the_row(self):
|
||||
"""域外取值降级为 `NULL` 且**不丢整行**(遥测必录);与缓存回放同一方向。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user