test(vision): assert vision aux calls carry no max_tokens cap

Covers the max-tokens-knob contract: vision call_kwargs omit max_tokens
entirely (configured values, defaults, and even an explicit
auxiliary.vision.max_tokens config entry must never be forwarded), so
providers use their full output budget.
This commit is contained in:
adikpb
2026-07-31 10:15:57 +04:00
committed by kshitij
parent dcc2f3de1d
commit ec470d9db2
+11
View File
@@ -276,11 +276,22 @@ class TestVisionConfig:
)
assert kwargs["temperature"] == 1.0
assert kwargs["timeout"] == 77.0
# No hardcoded output cap — the aux client omits max_tokens so the
# provider uses its full output budget (max-tokens-knob policy).
assert "max_tokens" not in kwargs
# Omitted values fall back to the built-in defaults.
kwargs = await call_with({"auxiliary": {"vision": {}}})
assert kwargs["temperature"] == 0.1
assert kwargs["timeout"] == 120.0
assert "max_tokens" not in kwargs
# Even an explicit auxiliary.vision.max_tokens config entry must NOT
# be forwarded: user-facing max_tokens knobs are policy-prohibited.
kwargs = await call_with({"auxiliary": {"vision": {"max_tokens": 8000}}})
assert "max_tokens" not in kwargs
assert kwargs["temperature"] == 0.1
assert kwargs["timeout"] == 120.0
class TestVisionSafetyGuards: