Python: Fix ag-ui regressions#2114
Merged
moonbox3 merged 9 commits intomicrosoft:mainfrom Nov 13, 2025
Merged
Conversation
Member
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes regressions in the AG-UI code that affected Dojo examples and client tool functionality. The changes improve tool result handling, message sanitization, and orchestration logic to properly support human-in-the-loop approval flows and declaration-only frontend rendering tools.
Key Changes:
- Fixed message adapter logic to properly distinguish between approval responses and tool results
- Added message sanitization to filter orphaned tool results and inject synthetic results for confirm_changes
- Fixed client tool merging to avoid overriding agent-configured tools with duplicate names
- Added comprehensive unit tests achieving 94% coverage
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
test_orchestrators_coverage.py |
New comprehensive test file covering orchestrator edge cases and sanitization logic |
test_agent_wrapper_comprehensive.py |
Updated test expectations for orphaned tool result handling |
main.py |
Added startup logging messages for the AG-UI examples server |
ui_generator_agent.py |
Converted @ai_function decorators to AIFunction declarations for frontend-rendered tools |
_orchestrators.py |
Major refactor adding message sanitization, deduplication, and improved tool merging logic |
_message_adapters.py |
Refactored tool result message handling to fix approval response detection |
_events.py |
Added tracking for tool calls that have ended to prevent duplicate events |
launch.json |
Fixed module name for debugging configuration |
Comments suppressed due to low confidence (1)
python/packages/ag-ui/tests/test_orchestrators_coverage.py:1
- This
if False:block is used to make the async generator syntactically valid without yielding. A cleaner approach would be to usereturnorraise AssertionError(...)directly without the dead code block.
# Copyright (c) Microsoft. All rights reserved.
python/packages/ag-ui/agent_framework_ag_ui/_message_adapters.py
Outdated
Show resolved
Hide resolved
python/packages/ag-ui/agent_framework_ag_ui/_message_adapters.py
Outdated
Show resolved
Hide resolved
eavanvalkenburg
approved these changes
Nov 12, 2025
alliscode
approved these changes
Nov 12, 2025
alliscode
approved these changes
Nov 12, 2025
alliscode
approved these changes
Nov 12, 2025
dmytrostruk
approved these changes
Nov 12, 2025
TaoChenOSU
approved these changes
Nov 13, 2025
arisng
pushed a commit
to arisng/agent-framework
that referenced
this pull request
Feb 2, 2026
* Bump ag-ui package version. Update CHANGELOG * Fix ag-ui bugs * Revert port test change * Cleanup * Intro factory funcs for samples * Revert package ver change
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
While introducing the AGUIChatClient, the related code changes affected the Dojo examples that were previously published. This PR fixes those regressions and now allows for the use of all seven examples, along with client tools, which previously wasn't working properly. More unit tests were added now for a 94% coverage across the ag-ui code.
Description
Fixes regressions. Adds more tests
Contribution Checklist