Skip to content

Python: fix(orchestrations): preserve multimodal content during agent handoff - #7823

Open
Manideep Malyala (manideep-malyala) wants to merge 4 commits into
microsoft:mainfrom
manideep-malyala:fix-multimodal-handoff
Open

Python: fix(orchestrations): preserve multimodal content during agent handoff#7823
Manideep Malyala (manideep-malyala) wants to merge 4 commits into
microsoft:mainfrom
manideep-malyala:fix-multimodal-handoff

Conversation

@manideep-malyala

@manideep-malyala Manideep Malyala (manideep-malyala) commented Aug 22, 2026

Copy link
Copy Markdown

Motivation & Context

Multi-modal workflows (like GroupChat and HandoffAgentExecutor) were silently dropping image and file attachments during agent handoffs. This prevented downstream Vision models from receiving the necessary context to complete their tasks. This fix ensures that multi-modal data is properly preserved across handoffs.

Description & Review Guide

  • What are the major changes?
    I updated the filtering logic in clean_conversation_for_handoff. The previous logic aggressively dropped all non-text content. I replaced this with a safer allowlist (text, data, uri, hosted_file, etc.) that preserves multi-modal context while still successfully stripping out tool-control payloads. I updated the test_handoff.py tests to cover this behavior, and added a regression test to test_sequential.py to explicitly confirm SequentialBuilder natively preserves this data.
  • What is the impact of these changes?
    Vision models will now correctly receive image context and file attachments from prior steps during sequential handoffs.
  • What do you want reviewers to focus on?
    Please take a quick look at the ALLOWED_CONTENT_TYPES set to ensure you agree with the types I allowed through. Thank you for your time and review!

Related Issue

Fixes #7822

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
  • This is not a breaking change.

Copilot AI balanced review requested due to automatic review settings August 22, 2026 20:00
@agent-framework-automation agent-framework-automation Bot added the python Usage: [Issues, PRs], Target: Python label Aug 22, 2026
@github-actions github-actions Bot changed the title fix(orchestrations): preserve multimodal content during agent handoff Python: fix(orchestrations): preserve multimodal content during agent handoff Aug 22, 2026

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

Preserves multimodal content during orchestration handoffs, while also adding an unrelated AG-UI snapshot option.

Changes:

  • Adds a handoff content allowlist.
  • Tests URI preservation and tool-content removal.
  • Adds configurable AG-UI snapshot suppression.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
python/packages/orchestrations/agent_framework_orchestrations/_orchestrator_helpers.py Retains allowlisted content during handoffs.
python/packages/orchestrations/tests/test_handoff.py Tests URI retention.
python/packages/ag-ui/agent_framework_ag_ui/_agent.py Adds snapshot emission configuration.
python/packages/ag-ui/agent_framework_ag_ui/_agent_run.py Applies snapshot suppression.
python/packages/ag-ui/tests/ag_ui/test_run.py Tests snapshot suppression.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread python/packages/ag-ui/agent_framework_ag_ui/_agent.py Outdated
Comment thread python/packages/orchestrations/tests/test_handoff.py Outdated

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

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

Suppressed comments (1)

python/packages/orchestrations/agent_framework_orchestrations/_orchestrator_helpers.py:31

  • The updated return description still conflicts with the function summary and bullets above, which say the helper is text-only and drops every non-text item. Update the complete contract to describe retained multimodal content and removed tool-control payloads.
        Cleaned conversation history with semantic multimodal content preserved, suitable for handoff routing

Comment thread python/packages/orchestrations/tests/test_handoff.py Outdated
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.

Bug: Multimodal content is dropped during agent handoff in orchestrator

2 participants