Python: quiet A2AExecutor logging for unmapped content types (#7034)

* Python: quiet A2AExecutor logging for unmapped content types

Tool-use responses include function_call/function_result content that the A2A executor does not surface, causing a WARNING per tool call. Log these at DEBUG and skip instead, matching the outbound content-conversion convention used across the Python chat clients.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ee74cc55-44df-4fcf-b38f-1f79f2600dfc

* Address PR review: assert debug log args and drop redundant cast

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ee74cc55-44df-4fcf-b38f-1f79f2600dfc
This commit is contained in:
Giles Odigwe
2026-07-14 00:44:31 -07:00
committed by GitHub
parent 7ca8bb55b6
commit cba77e3cd0
2 changed files with 24 additions and 4 deletions
@@ -273,8 +273,10 @@ class A2AExecutor(AgentExecutor):
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):
+20 -2
View File
@@ -842,7 +842,7 @@ class TestA2AExecutorHandleEvents:
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]
@@ -854,7 +854,25 @@ class TestA2AExecutorHandleEvents:
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()