Skip to content

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

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

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

Conversation

@manideep-malyala

Copy link
Copy Markdown
Contributor

Fixes #7822 (replaces #7823)

Summary

  • Preserves semantic multimodal content (uri, data, hosted_file, hosted_vector_store) for user messages during orchestrator handoffs.
  • Keeps assistant and other non-user messages text-only to prevent OpenAI API serialization failures.
  • Strips runtime-only tool-control payloads (function_call, function_result, approval_response).
  • Added unit tests in test_handoff.py covering all multimodal variants and regression test in test_sequential.py.

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.

🟡 Changes recommended

The sequential regression test iterates an input type that may be non-iterable, causing type-checking failure.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Preserves supported multimodal user content during orchestrator handoffs while removing runtime-only control payloads.

Changes:

  • Adds role-aware semantic content filtering.
  • Expands multimodal handoff tests.
  • Adds sequential URI propagation coverage.
File summaries
File Review
python/packages/orchestrations/tests/test_sequential.py Requires narrowing AgentRunInputs before iteration to satisfy type checking.
python/packages/orchestrations/tests/test_handoff.py Covers multimodal preservation and control-content filtering.
python/packages/orchestrations/agent_framework_orchestrations/_orchestrator_helpers.py Preserves allowed user multimodal content during cleanup.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Balanced

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

Comment thread python/packages/orchestrations/tests/test_sequential.py

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.

🔵 Needs a closer look

The role-sensitive serialization changes require final human review.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@Ricky-7-Yan Ricky-7-Yan 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.

Verified the current behavioral diff independently in an isolated worktree:

  • both new regression tests pass;
  • the complete test_handoff.py and test_sequential.py files pass (apart from their existing conditional skips);
  • Ruff check and format check pass for all three changed files.

I also checked the role boundary against the current content model and OpenAI Responses serializer. data / uri / hosted-file content is valid semantic user input, while the corresponding Responses items are input-only and must not be replayed on assistant messages. The allowlist therefore preserves the intended user context without reintroducing tool-control or assistant serialization failures. The latest Sequence narrowing addresses the earlier typing comment.

No blocking issues found on 9df09bc; approving this head.

@moonbox3

Copy link
Copy Markdown
Contributor

Manideep Malyala (@manideep-malyala) please use our PR body template.

@moonbox3

Copy link
Copy Markdown
Contributor

Verified the current behavioral diff independently in an isolated worktree:

  • both new regression tests pass;
  • the complete test_handoff.py and test_sequential.py files pass (apart from their existing conditional skips);
  • Ruff check and format check pass for all three changed files.

I also checked the role boundary against the current content model and OpenAI Responses serializer. data / uri / hosted-file content is valid semantic user input, while the corresponding Responses items are input-only and must not be replayed on assistant messages. The allowlist therefore preserves the intended user context without reintroducing tool-control or assistant serialization failures. The latest Sequence narrowing addresses the earlier typing comment.

No blocking issues found on 9df09bc; approving this head.

Ricky-7-Yan thanks for taking the time to look into these changes. Could you please refrain from submitting approval reviews across our PRs? Maintainers handle the required approvals, and the volume of additional reviews creates notification noise for the team. Specific bug reports or actionable feedback are welcome. Thanks for understanding.

@Ricky-7-Yan

Copy link
Copy Markdown
Contributor

Understood—thanks for letting me know. I'm sorry for the notification noise. I'll refrain from submitting approval-only reviews across agent-framework and will limit any future participation to concrete, actionable findings.

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: Bug: Multimodal content is dropped during agent handoff in orchestrator

4 participants