From ec470d9db212c9b19cdf2b31f59a1adc2fbbee03 Mon Sep 17 00:00:00 2001 From: adikpb <67222969+adikpb@users.noreply.github.com> Date: Fri, 31 Jul 2026 10:15:57 +0400 Subject: [PATCH] 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. --- tests/tools/test_vision_tools.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/tools/test_vision_tools.py b/tests/tools/test_vision_tools.py index 55b653d6fa..806382f649 100644 --- a/tests/tools/test_vision_tools.py +++ b/tests/tools/test_vision_tools.py @@ -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: