From 40b2f932789ea77d65c34a11554b6df54a7f15f1 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Thu, 25 Jun 2026 13:09:06 -0400 Subject: [PATCH] fix(test): update test_ai_loop_regressions_20260614 to patch provider_state.get_history The Phase 7 alias removal exposed a pre-existing test that patched src.ai_client._minimax_history and src.ai_client._minimax_history_lock. Those aliases no longer exist (deleted in Phase 7). Update the test to patch src.provider_state.get_history with a side_effect that returns a fresh empty ProviderHistory for 'minimax' and passes through other providers. This is the canonical pattern for tests that need to intercept the new provider_state.get_history(...) calls. --- tests/test_ai_loop_regressions_20260614.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_ai_loop_regressions_20260614.py b/tests/test_ai_loop_regressions_20260614.py index 337b5160..804bc1df 100644 --- a/tests/test_ai_loop_regressions_20260614.py +++ b/tests/test_ai_loop_regressions_20260614.py @@ -212,16 +212,19 @@ def test_fr3_minimax_thinking_in_returned_text() -> None: )) from src import openai_compatible as oc + from src import provider_state + from src.provider_state import ProviderHistory from src.vendor_capabilities import register, VendorCapabilities register(VendorCapabilities(vendor="minimax", model="MiniMax-M2.7", reasoning=True)) ai_client._model = "MiniMax-M2.7" + empty_minimax = ProviderHistory() + with patch.object(oc, "send_openai_compatible", side_effect=_fake_send_openai_compatible), \ patch("src.ai_client._ensure_minimax_client", return_value=MagicMock()), \ patch("src.ai_client._get_deepseek_tools", return_value=[]), \ patch("src.ai_client._trim_minimax_history", side_effect=lambda msgs, h: None), \ - patch("src.ai_client._minimax_history", new=[]), \ - patch("src.ai_client._minimax_history_lock", new=MagicMock()): + patch("src.provider_state.get_history", side_effect=lambda p: empty_minimax if p == "minimax" else provider_state._PROVIDER_HISTORIES[p]): result = ai_client._send_minimax("system", "user", ".", None, "", False, None, None, None) assert isinstance(result, Result), f"_send_minimax must return a Result, got {type(result).__name__}"