Skip to content

Python: quiet A2AExecutor logging for unmapped content types#7034

Open
giles17 wants to merge 2 commits into
microsoft:mainfrom
giles17:fix-a2a-tool-content-log
Open

Python: quiet A2AExecutor logging for unmapped content types#7034
giles17 wants to merge 2 commits into
microsoft:mainfrom
giles17:fix-a2a-tool-content-log

Conversation

@giles17

@giles17 giles17 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Motivation & Context

When an Agent Framework agent that uses tools (e.g. an MCP tool) is served via the A2A protocol, its response messages contain intermediate function_call and function_result content parts. The A2AExecutor only surfaces final user-facing output (text/data/uri), so these intermediate parts are correctly omitted — but it logged each omission at WARNING level with a misleading "does not yet support content type: … Omitted." message. This fires on every tool call, producing noisy, alarming output even though nothing is wrong and the final answer still reaches the client.

Description & Review Guide

  • What are the major changes?

    • In A2AExecutor.handle_events, the fall-through for unmapped content types now logs at DEBUG ("Skipping unsupported content type for A2A: %s") and skips, instead of emitting a WARNING. This matches the outbound content-conversion convention already used across the Python chat clients (Gemini, Anthropic, Bedrock, OpenAI, AG-UI), which uniformly logger.debug(...) and skip unmapped content.
    • Updated the corresponding unit tests to assert the omission is logged at DEBUG and not WARNING, and added a test covering intermediate tool content (function_call).
  • What is the impact of these changes?

    • Serving a tool-using agent over A2A no longer spams WARNINGs on every tool call. Content-conversion behavior is unchanged (the same content is still omitted); only the log level and message change. No public API changes.
  • What do you want reviewers to focus on?

    • Whether DEBUG + skip is the right consistency target (it aligns with the other Python chat clients' outbound conversion paths).

Related Issue

Fixes #6982

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

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
Copilot AI review requested due to automatic review settings July 9, 2026 23:58
@giles17 giles17 added the python Usage: [Issues, PRs], Target: Python label Jul 9, 2026
@giles17 giles17 marked this pull request as ready for review July 9, 2026 23:59

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Code Review

Reviewers: 5 | Confidence: 94% | Result: All clear

Reviewed: Correctness, Security Reliability, Test Coverage, Failure Modes, Design Approach


Automated review by giles17's agents

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces noisy, misleading WARNING logs emitted by the Python A2A server when it encounters content types that are intentionally omitted from A2A output (notably intermediate tool function_call / function_result parts), aligning A2A’s outbound content-conversion logging behavior with other Python chat clients.

Changes:

  • Downgrade the “unmapped content type” log in A2AExecutor.handle_events from WARNING to DEBUG with a clearer message.
  • Update/extend unit tests to assert unsupported/intermediate content is skipped with DEBUG logging (and not WARNING), including a new test for function_call.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
python/packages/a2a/agent_framework_a2a/_a2a_executor.py Changes the fall-through logging for unmapped content types to DEBUG and clarifies intent in comments.
python/packages/a2a/tests/test_a2a_executor.py Updates assertions for log level and adds coverage for intermediate tool content types being skipped quietly.

Comment thread python/packages/a2a/tests/test_a2a_executor.py
Comment thread python/packages/a2a/tests/test_a2a_executor.py
Comment thread python/packages/a2a/tests/test_a2a_executor.py
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/a2a/agent_framework_a2a
   _a2a_executor.py930100% 
TOTAL44138526388% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
8852 33 💤 0 ❌ 0 🔥 2m 15s ⏱️

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

Copilot-Session: ee74cc55-44df-4fcf-b38f-1f79f2600dfc
@giles17 giles17 enabled auto-merge July 10, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: [Python]: A2A server omits function_call and function_result content

3 participants