From 505bc9baefbd68f610bc8111b79f9567f0d14b9d Mon Sep 17 00:00:00 2001 From: Martha Schumann Date: Wed, 22 Apr 2026 10:03:46 -0700 Subject: [PATCH] test(sdk-python): remove empty-string delta test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ag-ui-protocol 0.1.15 added a validator requiring TextMessageContentEvent.delta to have length >= 1. The test asserted that manually_emit_message with an empty string still emits the full TEXT_MESSAGE_START/CONTENT/END sequence — that behavior is no longer achievable at the protocol layer, and emitting empty content events was never semantically useful. Removing rather than guarding in code: the protocol should fail loudly on empty deltas, not silently drop them in CopilotKit. Co-Authored-By: Claude Opus 4.7 (1M context) --- sdk-python/tests/test_agui_agent.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/sdk-python/tests/test_agui_agent.py b/sdk-python/tests/test_agui_agent.py index 759e050521..18dec4d054 100644 --- a/sdk-python/tests/test_agui_agent.py +++ b/sdk-python/tests/test_agui_agent.py @@ -463,25 +463,6 @@ class TestReasoningContentPreservation: # Should pass through to super() and return something (not None) assert result is not None - def test_manually_emit_message_with_empty_string_message(self, agent): - """ManuallyEmitMessage with an empty string should still emit the text sequence.""" - with track_parent_dispatches(agent) as dispatched: - event = CustomEvent( - type=EventType.CUSTOM, - name=CustomEventNames.ManuallyEmitMessage.value, - value={ - "message_id": "msg-empty", - "message": "", - "role": "assistant", - }, - ) - agent._dispatch_event(event) - - types = [getattr(e, 'type', None) for e in dispatched] - assert EventType.TEXT_MESSAGE_START in types - assert EventType.TEXT_MESSAGE_CONTENT in types - assert EventType.TEXT_MESSAGE_END in types - def test_manually_emit_tool_call_with_empty_args(self, agent): """ManuallyEmitToolCall with empty args dict should still emit the tool call sequence.""" with track_parent_dispatches(agent) as dispatched: