Skip to content

Python: Bug fixes for devui serialization and agent structured outputs - #1055

Merged
Eduard van Valkenburg (eavanvalkenburg) merged 3 commits into
microsoft:mainfrom
moonbox3:bug-fixes
Oct 1, 2025
Merged

Python: Bug fixes for devui serialization and agent structured outputs#1055
Eduard van Valkenburg (eavanvalkenburg) merged 3 commits into
microsoft:mainfrom
moonbox3:bug-fixes

Conversation

@moonbox3

@moonbox3 Evan Mattson (moonbox3) commented Oct 1, 2025

Copy link
Copy Markdown
Contributor

Motivation and Context

While testing, was running into two issues:

  1. Devui was failing to handle serializing an agent-related event. Needs a serialization helper (can later look to streamline in workflows as well)
  2. Structured outputs are getting lost when merging chat options because the pydantic class isn't serializable. Now we hold on to it, if configured, and reset it to response_format after merging chat options.

Devui now passes as we're handling structured outputs throughout the workflow/agent calls:

image

Description

Bug fixes

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

@moonbox3 Evan Mattson (moonbox3) added python Usage: [Issues, PRs], Target: Python agents Usage: [Issues, PRs], Target: Single agent labels Oct 1, 2025
Copilot AI review requested due to automatic review settings October 1, 2025 11:17
@moonbox3 Evan Mattson (moonbox3) added the workflows Usage: [Issues, PRs], Target: Workflows label Oct 1, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes two serialization-related bugs in the agent framework: DevUI failing to serialize agent-related events and structured outputs being lost during chat options merging.

  • Added a comprehensive payload serialization helper for DevUI to handle complex objects
  • Fixed structured output preservation during ChatOptions merging operations

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
python/packages/devui/agent_framework_devui/_mapper.py Added _serialize_payload method to handle serialization of workflow event data
python/packages/core/agent_framework/_types.py Fixed response_format preservation in ChatOptions merging logic

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread python/packages/devui/agent_framework_devui/_mapper.py Outdated
Comment thread python/packages/devui/agent_framework_devui/_mapper.py
Comment thread python/packages/core/agent_framework/_types.py
@markwallace-microsoft

Mark Wallace (markwallace-microsoft) commented Oct 1, 2025

Copy link
Copy Markdown
Contributor

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/core/agent_framework
   _types.py8819389%126–127, 145–146, 253, 255, 262, 281, 321, 357–358, 400, 536, 633–634, 636, 661, 668, 685–687, 743, 748–749, 751, 758–759, 761, 783, 790, 793–795, 800–801, 807–809, 910, 1007, 1138, 1142, 1144, 1323–1325, 1331–1332, 1491, 1496, 1531, 1536, 1540, 1544, 1713–1717, 1727, 1732, 1941, 2072, 2077, 2140–2142, 2165, 2185, 2201, 2209–2213, 2287, 2336, 2340, 2348, 2352–2354, 2415, 2419, 2423, 2427, 2430, 2484–2486, 2554, 2581, 2588
TOTAL10117179682% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
1174 95 💤 0 ❌ 0 🔥 30.938s ⏱️

Merged via the queue into microsoft:main with commit 19b9aee Oct 1, 2025
17 checks passed
Reuben Bond (ReubenBond) pushed a commit to ReubenBond/agent-framework that referenced this pull request Oct 28, 2025
microsoft#1055)

* Bug fixes for devui serialization and agent structured outputs

* Fix typing

* Add mapper serialization unit tests
AQ-1970 (Arturo-Quiroga-MSFT) pushed a commit to Arturo-Quiroga-MSFT/agent-framework-public that referenced this pull request Nov 23, 2025
microsoft#1055)

* Bug fixes for devui serialization and agent structured outputs

* Fix typing

* Add mapper serialization unit tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Usage: [Issues, PRs], Target: Single agent python Usage: [Issues, PRs], Target: Python workflows Usage: [Issues, PRs], Target: Workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants