drop provider-invalid reasoning-only history turns

This commit is contained in:
pewdiepie-archdaemon
2026-09-18 16:22:59 +00:00
parent 508e017d89
commit a394ea25d3
2 changed files with 2 additions and 3 deletions
-1
View File
@@ -3899,7 +3899,6 @@ def provider_wire_messages(messages):
item.get('role') == 'assistant' item.get('role') == 'assistant'
and not item.get('content') and not item.get('content')
and not item.get('tool_calls') and not item.get('tool_calls')
and not item.get('reasoning_content')
): ):
continue continue
cleaned.append(item) cleaned.append(item)
+2 -2
View File
@@ -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 import src.clean_agent_preview as module
messages = [{ messages = [{
@@ -540,7 +540,7 @@ def test_provider_wire_keeps_deepseek_reasoning_only_turn_for_continuity():
'reasoning_content': 'private provider reasoning token stream', 'reasoning_content': 'private provider reasoning token stream',
}] }]
assert module.provider_wire_messages(messages) == messages assert module.provider_wire_messages(messages) == []
@pytest.mark.asyncio @pytest.mark.asyncio