From 519911456a2af634990ef1f0d5a58dc146fbf758 Mon Sep 17 00:00:00 2001 From: Lingao Meng Date: Sat, 4 Apr 2026 12:17:17 +0800 Subject: [PATCH] test(provider): fix incorrect assertion in reasoning_content sanitize test The test test_openai_compat_strips_message_level_reasoning_fields was added in fbedf7a and incorrectly asserted that reasoning_content and extra_content should be stripped from messages. This contradicts the intent of b5302b6 which explicitly added these fields to _ALLOWED_MSG_KEYS to preserve them through sanitization. Rename the test and fix assertions to match the original design intent: reasoning_content and extra_content at message level should be preserved, and extra_content inside tool_calls should also be preserved. Signed-off-by: Lingao Meng --- tests/providers/test_litellm_kwargs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/providers/test_litellm_kwargs.py b/tests/providers/test_litellm_kwargs.py index cc8347f0e..35ab56f92 100644 --- a/tests/providers/test_litellm_kwargs.py +++ b/tests/providers/test_litellm_kwargs.py @@ -226,7 +226,7 @@ def test_openai_model_passthrough() -> None: assert provider.get_default_model() == "gpt-4o" -def test_openai_compat_strips_message_level_reasoning_fields() -> None: +def test_openai_compat_preserves_message_level_reasoning_fields() -> None: with patch("nanobot.providers.openai_compat_provider.AsyncOpenAI"): provider = OpenAICompatProvider() @@ -247,8 +247,8 @@ def test_openai_compat_strips_message_level_reasoning_fields() -> None: } ]) - assert "reasoning_content" not in sanitized[0] - assert "extra_content" not in sanitized[0] + assert sanitized[0]["reasoning_content"] == "hidden" + assert sanitized[0]["extra_content"] == {"debug": True} assert sanitized[0]["tool_calls"][0]["extra_content"] == {"google": {"thought_signature": "sig"}}