test: fast-lane suite asserts Ollama's native thinking-off shape

Routing a task-level ``reasoning_effort: none`` through the provider profile
means the certified Ollama fast lane now sends the profile's own disable
shape — top-level ``reasoning_effort="none"`` plus ``think=False`` — instead
of forwarding a pass-through ``extra_body.reasoning`` that Ollama's /v1 does
not read. The two fast-lane tests encoded the old pass-through; they keep
their intent (thinking is off, and only on the certified route) against the
native wire.
This commit is contained in:
teknium1
2026-09-20 00:48:11 -07:00
committed by Teknium
parent cd78aad17a
commit 8b56e956f6

View File

@@ -181,7 +181,11 @@ def test_certified_fast_lane_ignores_legacy_cap_and_preserves_reasoning():
request = client.chat.completions.create.call_args.kwargs
assert "max_tokens" not in request
assert request["extra_body"]["reasoning"] == {"enabled": False}
# Task-level ``none`` reaches the wire in the Ollama profile's native disable shape
# (top-level reasoning_effort + think=False), not as a pass-through extra_body.reasoning.
assert request["reasoning_effort"] == "none"
assert request["extra_body"]["think"] is False
assert "reasoning" not in request["extra_body"]
def test_uncertified_effective_primary_route_does_not_receive_fast_cap():
@@ -371,11 +375,13 @@ def test_fallback_reasoning_requires_independent_route_certification():
assert "max_tokens" not in uncertified
assert "max_completion_tokens" not in uncertified
assert "reasoning" not in uncertified.get("extra_body", {})
assert "think" not in uncertified.get("extra_body", {})
assert "max_tokens" not in certified
assert certified["extra_body"]["reasoning"] == {
"enabled": False,
"effort": "none",
}
# Ollama's native disable shape (top-level reasoning_effort + think=False) replaces the
# pass-through ``extra_body.reasoning`` the certified route used to forward.
assert certified["reasoning_effort"] == "none"
assert certified["extra_body"]["think"] is False
assert "reasoning" not in certified["extra_body"]
def test_reasoning_effort_aliases_certify_like_none():