From 76be77009165cab23f177ba3d6ba14c2c15129fb Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Thu, 2 Jul 2026 06:25:47 +0530 Subject: [PATCH] test(moa): assert aux cap against model resolver, not frozen literal Follow-up to the salvaged fix: the regression test asserted a frozen max_tokens == 128_000 literal, coupling it to the Opus-4-8 model table. Assert against _get_anthropic_max_output("claude-opus-4-8") plus > 2000 instead, so the test survives model-table churn while still catching a regression to the old `or 2000` fallback. --- tests/agent/test_auxiliary_client.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/agent/test_auxiliary_client.py b/tests/agent/test_auxiliary_client.py index 3b9e05034..c1a9f0852 100644 --- a/tests/agent/test_auxiliary_client.py +++ b/tests/agent/test_auxiliary_client.py @@ -1173,7 +1173,16 @@ class TestVisionClientFallback: ) assert response.choices[0].message.content == "aux response" - assert captured_kwargs["max_tokens"] == 128_000 + # Behavior contract, not a frozen literal: a capless native-Anthropic + # aux call must default to the model's native output ceiling (resolved + # via _get_anthropic_max_output) rather than the old hidden 2000 cap. + # Asserting against the resolver keeps this test alive across + # model-table churn while still catching a regression to `or 2000`. + from agent.anthropic_adapter import _get_anthropic_max_output + + expected_ceiling = _get_anthropic_max_output("claude-opus-4-8") + assert expected_ceiling > 2000 + assert captured_kwargs["max_tokens"] == expected_ceiling class TestAuxiliaryPoolAwareness: