From a394ea25d341cfcb1a8748eb79c31f3fedd1cd9f Mon Sep 17 00:00:00 2001 From: pewdiepie-archdaemon Date: Fri, 18 Sep 2026 16:22:59 +0000 Subject: [PATCH] drop provider-invalid reasoning-only history turns --- src/clean_agent_preview.py | 1 - tests/test_clean_agent_preview.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/clean_agent_preview.py b/src/clean_agent_preview.py index 4589f7329..5ee0607c8 100644 --- a/src/clean_agent_preview.py +++ b/src/clean_agent_preview.py @@ -3899,7 +3899,6 @@ def provider_wire_messages(messages): item.get('role') == 'assistant' and not item.get('content') and not item.get('tool_calls') - and not item.get('reasoning_content') ): continue cleaned.append(item) diff --git a/tests/test_clean_agent_preview.py b/tests/test_clean_agent_preview.py index 05c8376c3..5e9fd539b 100644 --- a/tests/test_clean_agent_preview.py +++ b/tests/test_clean_agent_preview.py @@ -531,7 +531,7 @@ def test_repeated_off_contract_artifact_calls_trigger_single_file_body_handoff() ) -def test_provider_wire_keeps_deepseek_reasoning_only_turn_for_continuity(): +def test_provider_wire_drops_deepseek_reasoning_only_turn_rejected_by_provider(): import src.clean_agent_preview as module messages = [{ @@ -540,7 +540,7 @@ def test_provider_wire_keeps_deepseek_reasoning_only_turn_for_continuity(): 'reasoning_content': 'private provider reasoning token stream', }] - assert module.provider_wire_messages(messages) == messages + assert module.provider_wire_messages(messages) == [] @pytest.mark.asyncio