Skip to content

Conversation

@victordibia
Copy link
Contributor

@victordibia victordibia commented Oct 20, 2025

Motivation and Context

Resolve timestamp overwriting and Content serialization errors

Fixes #1483,
Fixes #1548
Partial improvements for #1476

Description

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.

victordibia and others added 3 commits October 16, 2025 21:51
…d workflows

- Replace custom workflow events with OpenAI Responses API standard lifecycle events
- Add AgentStartedEvent, AgentCompletedEvent, AgentFailedEvent for clean separation
- Implement ExecutorActionItem for workflow executor tracking
- Convert informational events to trace events to reduce noise
- Update README mapper table with comprehensive event mappings
- Maintain full backward compatibility with legacy events
…rrors

- Fix tool call timestamps being overwritten on each render (microsoft#1483)
- Add recursive Content serialization to handle ChatMessage and nested objects (microsoft#1548)
- Implement proper MCP tool cleanup on server shutdown
- Add timestamp field to function_result.complete events
- Enhance credential and client resource cleanup

Fixes microsoft#1483, microsoft#1548
Partial improvements for microsoft#1476
@markwallace-microsoft markwallace-microsoft added documentation Improvements or additions to documentation python labels Oct 20, 2025
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Oct 20, 2025

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
TOTAL11681188183% 
report-only-changed-files is enabled. No files were changed during this commit :)

Python Unit Test Overview

Tests Skipped Failures Errors Time
1371 98 💤 0 ❌ 0 🔥 27.041s ⏱️

@victordibia victordibia changed the title Python: Fix Serialization, Timestamp and Other Issues Python: DevUI Fix Serialization, Timestamp and Other Issues Oct 21, 2025
@victordibia victordibia marked this pull request as ready for review October 21, 2025 21:42
Copy link
Contributor

Copilot AI left a 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 resolves several critical issues in the Python DevUI package related to event serialization, timestamp handling, and resource cleanup. The changes improve the reliability and correctness of the DevUI by fixing how tool call timestamps are displayed, handling nested Content objects from MCP tools, and ensuring proper cleanup of resources on server shutdown.

Key changes:

  • Fixed timestamp handling to prevent overwriting on each render cycle
  • Added recursive Content serialization for MCP tool results
  • Implemented comprehensive resource cleanup for credentials and MCP tools
  • Enhanced OpenAI event format support with proper lifecycle events

Reviewed Changes

Copilot reviewed 19 out of 21 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
python/packages/devui/tests/test_server.py Added comprehensive tests for credential and MCP tool cleanup functionality
python/packages/devui/tests/test_mapper.py Added tests for Content serialization, lifecycle events, and proper OpenAI event hierarchy
python/packages/devui/frontend/src/utils/workflow-utils.ts Updated to handle new standard OpenAI events alongside legacy workflow events
python/packages/devui/frontend/src/types/openai.ts Added standard OpenAI lifecycle event types and flexible WorkflowItem interfaces
python/packages/devui/frontend/src/types/index.ts Re-exported new event types and interfaces
python/packages/devui/frontend/src/types/agent-framework.ts Updated input field type and removed deprecated input_data
python/packages/devui/frontend/src/services/api.ts Simplified workflow request handling to use input field directly
python/packages/devui/frontend/src/components/ui/markdown-renderer.tsx Simplified React imports
python/packages/devui/frontend/src/components/layout/debug-panel.tsx Added stable timestamp extraction logic to prevent timestamp overwriting
python/packages/devui/frontend/src/components/features/workflow/workflow-view.tsx Updated to handle standard OpenAI events for workflow tracking
python/packages/devui/frontend/src/App.tsx Fixed backend URL display to show current value
python/packages/devui/agent_framework_devui/ui/index.html Updated build artifact reference
python/packages/devui/agent_framework_devui/models/_openai_custom.py Added agent lifecycle events and ExecutorActionItem types
python/packages/devui/agent_framework_devui/models/__init__.py Exported new custom event types
python/packages/devui/agent_framework_devui/_server.py Enhanced cleanup to handle credentials and MCP tools
python/packages/devui/agent_framework_devui/_mapper.py Added recursive Content serialization and agent lifecycle event handling
python/packages/devui/agent_framework_devui/_executor.py Added agent lifecycle event emission and simplified workflow input handling
python/packages/devui/agent_framework_devui/_discovery.py Removed emoji from log messages
python/packages/devui/README.md Updated documentation with MCP tools usage and improved event mapping table

@victordibia victordibia enabled auto-merge October 22, 2025 15:57
@victordibia victordibia added this pull request to the merge queue Oct 22, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 22, 2025
@victordibia victordibia added this pull request to the merge queue Oct 22, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 22, 2025
@victordibia victordibia enabled auto-merge October 22, 2025 21:21
@victordibia victordibia added this pull request to the merge queue Oct 22, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 22, 2025
@victordibia victordibia enabled auto-merge October 23, 2025 14:53
@victordibia victordibia added this pull request to the merge queue Oct 23, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 23, 2025
@victordibia victordibia added this pull request to the merge queue Oct 23, 2025
Merged via the queue into microsoft:main with commit 6b66a34 Oct 23, 2025
21 checks passed
ReubenBond pushed a commit to ReubenBond/agent-framework that referenced this pull request Oct 28, 2025
…t#1584)

* refactor(devui): adopt standard OpenAI lifecycle events for agents and workflows

- Replace custom workflow events with OpenAI Responses API standard lifecycle events
- Add AgentStartedEvent, AgentCompletedEvent, AgentFailedEvent for clean separation
- Implement ExecutorActionItem for workflow executor tracking
- Convert informational events to trace events to reduce noise
- Update README mapper table with comprehensive event mappings
- Maintain full backward compatibility with legacy events

* fix(devui): resolve timestamp overwriting and Content serialization errors

- Fix tool call timestamps being overwritten on each render (microsoft#1483)
- Add recursive Content serialization to handle ChatMessage and nested objects (microsoft#1548)
- Implement proper MCP tool cleanup on server shutdown
- Add timestamp field to function_result.complete events
- Enhance credential and client resource cleanup

Fixes microsoft#1483, microsoft#1548
Partial improvements for microsoft#1476
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: DevUI returns error with AgentOrchestration patterns Python: DevUI - Tool call timestamps are being overwritten

4 participants