Python: [BREAKING] simplify ag-ui run logic, fix mcp bugs, fix anthropic client issues in ag-ui#3322
Merged
moonbox3 merged 9 commits intomicrosoft:mainfrom Jan 23, 2026
Merged
Conversation
4 tasks
Member
Contributor
There was a problem hiding this comment.
Pull request overview
This PR performs a major refactoring of the AG-UI orchestration system to simplify the run logic and fix several bugs. The changes consolidate orchestration into a single linear flow in _run.py, removing the complex orchestrator pattern and confirmation strategies.
Changes:
- Simplified orchestration by consolidating into a single
run_agent_stream()function in_run.py - Fixed Anthropic client bug where empty text content was causing API errors
- Fixed MCP tool approval handling by ensuring approval tools are properly passed to the execution handler
- Removed confirmation strategies (BREAKING CHANGE)
Reviewed changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
python/packages/core/agent_framework/_tools.py |
Added debug logging and fixed conversation_id filtering in tool invocation |
python/packages/core/agent_framework/_agents.py |
Added tool deduplication by name when merging options |
python/packages/anthropic/agent_framework_anthropic/_chat_client.py |
Fixed empty text content handling and added conversation_id to ignored options |
python/packages/ag-ui/agent_framework_ag_ui/_run.py |
New 949-line orchestration implementation replacing orchestrators |
python/packages/ag-ui/agent_framework_ag_ui/_orchestration/_tooling.py |
Fixed approval tool detection to ensure tools are passed when needed |
python/packages/ag-ui/agent_framework_ag_ui/_agent.py |
Simplified to use new run_agent_stream() function |
python/packages/ag-ui/agent_framework_ag_ui/__init__.py |
Removed confirmation strategy exports |
python/packages/ag-ui/agent_framework_ag_ui_examples/agents/ |
Removed confirmation_strategy parameters from agent examples |
| Multiple test files | Removed obsolete tests and added new tests for simplified architecture |
python/packages/ag-ui/agent_framework_ag_ui_examples/server/main.py
Outdated
Show resolved
Hide resolved
eavanvalkenburg
approved these changes
Jan 22, 2026
dmytrostruk
approved these changes
Jan 23, 2026
arisng
pushed a commit
to arisng/agent-framework
that referenced
this pull request
Feb 2, 2026
…pic client issues in ag-ui (microsoft#3322) * Refactor ag-ui to simplify flow * Refactoring * Fix backend tool * Update tests * Improvements * Fix mypy * Fixes * Fix json serialize errors
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
This refactor restructures AG-UI orchestration to reduce bespoke state handling and make the flow maintainable. The existing code was growing in complexity and brittleness; this change consolidates orchestration, simplifies state transitions, and removes ad hoc management paths.
Important
The only breaking change here is we're removing the confirmation strategies - no need for this custom behavior. The
confirmation_strategyarg is no longer passed into AgentFrameworkAgent.Description
Testing:
Contribution Checklist