Python: (ag-ui): Add Workflow Support, Harden Streaming Semantics, and add Dynamic Handoff Demo#3911
Open
moonbox3 wants to merge 13 commits intomicrosoft:mainfrom
Open
Python: (ag-ui): Add Workflow Support, Harden Streaming Semantics, and add Dynamic Handoff Demo#3911moonbox3 wants to merge 13 commits intomicrosoft:mainfrom
moonbox3 wants to merge 13 commits intomicrosoft:mainfrom
Conversation
Member
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds first-class AG-UI workflow execution support, hardens streaming error handling, and introduces a dynamic handoff demo. The changes enable workflows to be served directly through AG-UI endpoints alongside agents, add multimodal input support, and improve error handling to emit RUN_ERROR events instead of silently terminating streams.
Changes:
- Introduces
AgentFrameworkWorkflowwrapper for nativeWorkflowobjects with thread-scoped factory support - Breaking change: renames
run_agent()torun()across all AG-UI protocol implementations - Adds streaming error handling that emits
RUN_ERRORevents for stream/encoding failures - Implements multimodal input parsing for image/audio/video/document content types
- Adds comprehensive handoff workflow demo with tool approval gates
Reviewed changes
Copilot reviewed 53 out of 56 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
python/packages/ag-ui/agent_framework_ag_ui/_workflow.py |
New workflow wrapper with thread-scoped factory support |
python/packages/ag-ui/agent_framework_ag_ui/_workflow_run.py |
Native workflow-to-AG-UI event stream mapper |
python/packages/ag-ui/agent_framework_ag_ui/_run_common.py |
Shared emission helpers extracted from agent/workflow runners |
python/packages/ag-ui/agent_framework_ag_ui/_agent.py |
Breaking change: run_agent() → run() |
python/packages/ag-ui/agent_framework_ag_ui/_endpoint.py |
Error handling improvements and workflow protocol support |
python/packages/ag-ui/agent_framework_ag_ui/_message_adapters.py |
Multimodal input parsing with base64 decoding |
python/packages/orchestrations/agent_framework_orchestrations/_handoff.py |
JSON serialization fix for handoff function results |
python/samples/demos/ag_ui_workflow_handoff/backend/server.py |
New handoff demo backend |
python/samples/demos/ag_ui_workflow_handoff/frontend/ |
React frontend for handoff demo |
Files not reviewed (1)
- python/samples/demos/ag_ui_workflow_handoff/frontend/package-lock.json: Language not supported
TaoChenOSU
reviewed
Feb 13, 2026
| self.workflow = workflow | ||
| self._workflow_factory = workflow_factory | ||
| self._workflow_by_thread: dict[str, Workflow] = {} | ||
| self.name = name if name is not None else getattr(workflow, "name", "workflow") |
Contributor
There was a problem hiding this comment.
Suggested change
| self.name = name if name is not None else getattr(workflow, "name", "workflow") | |
| self.name = name if name is not None else workflow.name |
TaoChenOSU
reviewed
Feb 13, 2026
| self._workflow_factory = workflow_factory | ||
| self._workflow_by_thread: dict[str, Workflow] = {} | ||
| self.name = name if name is not None else getattr(workflow, "name", "workflow") | ||
| self.description = description if description is not None else getattr(workflow, "description", "") |
Contributor
There was a problem hiding this comment.
Suggested change
| self.description = description if description is not None else getattr(workflow, "description", "") | |
| self.description = description if description is not None else workflow.description or "" |
TaoChenOSU
approved these changes
Feb 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
AgentFrameworkWorkflow, with endpoint support for both wrapped agents and workflows using.run(...)._agent_runand consolidated shared emission behavior in_run_common.ToolCallResultEventserialization bug for non-string tool results.200with error dict),RUN_ERRORinstead of silently terminating.CUSTOM(name="usage") and surfaced diagnostics in the handoff demo UI..add_handoff(...)) and added HITL-gated replacement approval (submit_replacement,submit_refund) as examples on HITL tool approvals with AG-UI.Breaking Changes
run_agent(...); now usesrun(...)for both an agent and a workflow run.agent_framework.ag_uifacade exports to a more stable public surface.Demo Screenshots
Description
Contribution Checklist