Skip to content

Python: Title: DevUI Fix WorkflowFailedEvent error extraction #2706

Merged
victordibia merged 4 commits intomainfrom
devui_fix_error_msg
Dec 8, 2025
Merged

Python: Title: DevUI Fix WorkflowFailedEvent error extraction #2706
victordibia merged 4 commits intomainfrom
devui_fix_error_msg

Conversation

@victordibia
Copy link
Contributor

Motivation and Context

Summary

  • Fixed WorkflowFailedEvent mapping to read from details.message instead of non-existent error attribute
  • Added test coverage to catch regressions

Problem

WorkflowFailedEvent handler read event.error, but the class uses details (type WorkflowErrorDetails). This caused workflow failures to always display "Unknown error" instead of the actual message.

Test plan

  • All 121 DevUI tests pass
  • Added test_workflow_failed_event_with_extra to verify details.extra inclusion
  • Enhanced test_workflow_failed_event to verify actual error message extraction

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.

…d of error Body:

Summary
Fixed WorkflowFailedEvent mapping to extract error message from details.message instead of non-existent error attribute
Added support for including details.extra context in error messages when present
Problem
The WorkflowFailedEvent handler in _mapper.py was reading event.error, but WorkflowFailedEvent uses a details attribute (of type WorkflowErrorDetails), not error. This caused all workflow failures to display "Unknown error" in the UI instead of the actual error message.
Fix
Updated the handler to match the pattern already used by ExecutorFailedEvent:
Read from event.details instead of event.error
Extract details.message for the error text
Include details.extra context when available
@github-actions github-actions bot changed the title Title: DevUI Fix WorkflowFailedEvent error extraction Python: Title: DevUI Fix WorkflowFailedEvent error extraction Dec 8, 2025
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Dec 8, 2025

Python Test Coverage

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

Python Unit Test Overview

Tests Skipped Failures Errors Time
2322 130 💤 0 ❌ 0 🔥 1m 0s ⏱️

@victordibia victordibia marked this pull request as ready for review December 8, 2025 20:05
Copilot AI review requested due to automatic review settings December 8, 2025 20:05
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 fixes a bug in WorkflowFailedEvent error extraction where the handler was reading from a non-existent error attribute instead of the correct details.message field, causing all workflow failures to display "Unknown error".

Key Changes:

  • Updated WorkflowFailedEvent handler to correctly extract error messages from details.message (WorkflowErrorDetails type)
  • Added support for including extra context from WorkflowErrorDetails in error messages
  • Enhanced test coverage to verify correct error message extraction and extra context handling

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
python/packages/devui/agent_framework_devui/_mapper.py Fixed error extraction logic to read from details.message instead of non-existent error attribute, and added handling for extra context field
python/packages/devui/tests/test_mapper.py Added assertions to verify actual error message extraction (not "Unknown error") and added new test for extra context inclusion

@victordibia victordibia added this pull request to the merge queue Dec 8, 2025
Merged via the queue into main with commit d889fa6 Dec 8, 2025
23 checks passed
@victordibia victordibia deleted the devui_fix_error_msg branch December 8, 2025 22:09
arisng pushed a commit to arisng/agent-framework that referenced this pull request Feb 2, 2026
…oft#2706)

* Title: Fix WorkflowFailedEvent error extraction to use details instead of error Body:
Summary
Fixed WorkflowFailedEvent mapping to extract error message from details.message instead of non-existent error attribute
Added support for including details.extra context in error messages when present
Problem
The WorkflowFailedEvent handler in _mapper.py was reading event.error, but WorkflowFailedEvent uses a details attribute (of type WorkflowErrorDetails), not error. This caused all workflow failures to display "Unknown error" in the UI instead of the actual error message.
Fix
Updated the handler to match the pattern already used by ExecutorFailedEvent:
Read from event.details instead of event.error
Extract details.message for the error text
Include details.extra context when available

* improve error handling consistency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants