Python: DevUI, Fix message serialization issue, improve tests #2674
Merged
victordibia merged 3 commits intomainfrom Dec 6, 2025
Merged
Python: DevUI, Fix message serialization issue, improve tests #2674victordibia merged 3 commits intomainfrom
victordibia merged 3 commits intomainfrom
Conversation
Member
alliscode
approved these changes
Dec 6, 2025
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical message serialization bug in the Python DevUI package and significantly improves test coverage. The main issue was that ExecutorCompletedEvent.data could contain nested non-JSON-serializable objects (AgentExecutorResponse with AgentRunResponse and ChatMessage), which caused serialization failures when events were sent over Server-Sent Events (SSE).
Key Changes:
- Fixed serialization of
ExecutorCompletedEventby calling_serialize_value()on the result data before including it in the event - Corrected
ExecutorFailedEventto use thedetailsfield instead oferrorfield - Added comprehensive regression tests using real agent_framework classes (not mocks) to ensure proper serialization
- Removed test skips and improved test organization with a new
test_helpers.pymodule
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| python/packages/devui/agent_framework_devui/_mapper.py | Core serialization fix: calls _serialize_value() on ExecutorCompletedEvent.data; corrects field access for ExecutorFailedEvent from 'error' to 'details' |
| python/packages/devui/agent_framework_devui/_server.py | Improves error logging by adding exc_info=True for better debugging context |
| python/packages/devui/tests/test_mapper.py | Major refactoring with new comprehensive tests for serialization, executor events, workflow events, and edge cases using real classes |
| python/packages/devui/tests/test_helpers.py | New file providing reusable test utilities including mock clients, agents, and factory functions for test data |
| python/packages/devui/tests/test_execution.py | Extensive improvements with full pipeline tests, workflow execution tests, and proper fixtures using real ChatAgent with mock LLM |
| python/packages/devui/tests/test_server.py | Unskipped test and improved assertions for entity discovery |
| python/packages/devui/tests/test_discovery.py | Unskipped agent discovery test |
| python/packages/devui/tests/test_cleanup_hooks.py | Fixed field name from content to contents to match API |
| python/packages/devui/pyproject.toml | Added pythonpath configuration for test discovery |
ermattson
approved these changes
Dec 6, 2025
moonbox3
approved these changes
Dec 6, 2025
arisng
pushed a commit
to arisng/agent-framework
that referenced
this pull request
Feb 2, 2026
…oft#2674) * fix message serialization issue, improve tests for devui * update tests
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
Python: DevUI, Fix message serialization issue, improve tests .
Thanks @pamelafox
Description
Contribution Checklist