-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Python: [BREAKING] simplify ag-ui run logic, fix mcp bugs, fix anthropic client issues in ag-ui #3322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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