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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user