Python: fix(orchestrations): preserve multimodal content during agent handoff - #8083
Conversation
There was a problem hiding this comment.
🟡 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.
…tation in orchestrator helpers
Ricky-7-Yan
left a comment
There was a problem hiding this comment.
Verified the current behavioral diff independently in an isolated worktree:
- both new regression tests pass;
- the complete
test_handoff.pyandtest_sequential.pyfiles 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.
|
Manideep Malyala (@manideep-malyala) please use our PR body template. |
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. |
|
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. |
Fixes #7822 (replaces #7823)
Summary
uri,data,hosted_file,hosted_vector_store) forusermessages during orchestrator handoffs.assistantand other non-user messages text-only to prevent OpenAI API serialization failures.function_call,function_result,approval_response).test_handoff.pycovering all multimodal variants and regression test intest_sequential.py.