From 538ac55880a42918704e4213ac48b45637e8104c Mon Sep 17 00:00:00 2001 From: Josh Vera Date: Sun, 13 Jul 2025 10:08:05 -0600 Subject: [PATCH] fix: Clear restriction service singleton in o3-pro test setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test was failing when run in the full test suite because the ModelRestrictionService singleton persisted restrictions from previous tests. Specifically, test_fallback_with_shorthand_restrictions sets OPENAI_ALLOWED_MODELS="mini" which blocked o3-pro. Added utils.model_restrictions._restriction_service = None to ensure the test starts with clean restriction state. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- tests/test_o3_pro_output_text_fix.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_o3_pro_output_text_fix.py b/tests/test_o3_pro_output_text_fix.py index 13ae967..b0706fb 100644 --- a/tests/test_o3_pro_output_text_fix.py +++ b/tests/test_o3_pro_output_text_fix.py @@ -34,6 +34,11 @@ class TestO3ProOutputTextFix: def setup_method(self): """Set up the test by ensuring clean registry state.""" + # Clear the restriction service singleton to ensure clean state + import utils.model_restrictions + + utils.model_restrictions._restriction_service = None + # Use the new public API for registry cleanup ModelProviderRegistry.reset_for_testing() # Provider registration is now handled by inject_transport helper