Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions python/packages/a2a/agent_framework_a2a/_a2a_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,10 @@ async def handle_events(
elif content.type == "uri" and content.uri:
parts.append(Part(url=content.uri, media_type=content.media_type or ""))
else:
# Silently skip unsupported content types
logger.warning("A2AExecutor does not yet support content type: %s. Omitted.", content.type)
# Content that doesn't map to an A2A part (e.g. intermediate function_call /
# function_result from tool use) is skipped; only final user-facing output
# (text/data/uri) is surfaced.
logger.debug("Skipping unsupported content type for A2A: %s", content.type)

if parts:
if isinstance(item, AgentResponseUpdate):
Expand Down
22 changes: 20 additions & 2 deletions python/packages/a2a/tests/test_a2a_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ async def test_handle_agent_response_update_subsequent_time(
assert call_kwargs["append"] is True

async def test_handle_unsupported_content_type(self, executor: A2AExecutor, mock_updater: MagicMock) -> None:
"""Test handling messages with unsupported content types."""
"""Test that unsupported content types are skipped quietly (debug, not warning)."""
# Arrange
message = Message(
contents=[Content(type=cast(Any, "unknown"), text="Some text")], # type: ignore[arg-type]
Expand All @@ -854,7 +854,25 @@ async def test_handle_unsupported_content_type(self, executor: A2AExecutor, mock
await executor.handle_events(message, mock_updater)

# Assert
mock_logger.warning.assert_called_once()
mock_logger.warning.assert_not_called()
mock_logger.debug.assert_called_once_with("Skipping unsupported content type for A2A: %s", "unknown")
mock_updater.update_status.assert_not_called()

async def test_handle_intermediate_content_type(self, executor: A2AExecutor, mock_updater: MagicMock) -> None:
"""Test that intermediate tool content (e.g. function_call) is skipped quietly (debug, not warning)."""
# Arrange
message = Message(
contents=[Content(type="function_call")],
role="assistant",
)

# Act
with patch("agent_framework_a2a._a2a_executor.logger") as mock_logger:
await executor.handle_events(message, mock_updater)

# Assert
mock_logger.warning.assert_not_called()
mock_logger.debug.assert_called_once_with("Skipping unsupported content type for A2A: %s", "function_call")
mock_updater.update_status.assert_not_called()


Expand Down
Loading