Skip to content

Conversation

@moonbox3
Copy link
Contributor

Motivation and Context

WorkflowOutputEvent used source_executor_id while ExecutorEvent subclasses (ExecutorInvokedEvent, ExecutorCompletedEvent, ExecutorFailedEvent) used executor_id. This inconsistency caused confusion when iterating over workflow events:

for event in events:
    executor_id = getattr(event, 'executor_id', None)  # None for WorkflowOutputEvent

This PR renames WorkflowOutputEvent.source_executor_id to executor_id for uniform attribute access across all executor-related events.

Before:

ExecutorInvokedEvent(executor_id=my_executor, ...)
WorkflowOutputEvent(data=..., source_executor_id=my_executor)  # inconsistent
ExecutorCompletedEvent(executor_id=my_executor, ...)

After:

ExecutorInvokedEvent(executor_id=my_executor, ...)
WorkflowOutputEvent(data=..., executor_id=my_executor)  # consistent
ExecutorCompletedEvent(executor_id=my_executor, ...)

Caution

  • WorkflowOutputEvent.source_executor_idWorkflowOutputEvent.executor_id
  • Constructor parameter renamed: WorkflowOutputEvent(data=..., executor_id=...)

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.

@moonbox3 moonbox3 self-assigned this Jan 12, 2026
Copilot AI review requested due to automatic review settings January 12, 2026 03:04
@moonbox3 moonbox3 added python workflows Related to Workflows in agent-framework breaking change Introduces changes that are not backward compatible and may require updates to dependent code. labels Jan 12, 2026
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Jan 12, 2026

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/core/agent_framework/_workflows
   _agent.py2704384%61, 69–75, 103–104, 260, 316, 330, 343, 392–395, 401, 407, 411–412, 415–421, 425–426, 477, 484, 490–491, 497, 509, 541, 548, 569, 576, 580, 591
   _events.py1301489%59–60, 78, 86, 90, 180–181, 232, 257, 294, 312, 337, 378, 392
   _workflow_context.py1732684%61–62, 70, 74, 88, 164, 189, 302, 410, 419, 424, 453–455, 457, 459–460, 462–463, 472–474, 476–478, 480
TOTAL17645289683% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
2617 154 💤 0 ❌ 0 🔥 1m 4s ⏱️

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 renames WorkflowOutputEvent.source_executor_id to executor_id for consistency with other executor-related events (ExecutorInvokedEvent, ExecutorCompletedEvent, ExecutorFailedEvent) which all use executor_id. This breaking change provides uniform attribute access across all executor-related events.

Changes:

  • Renamed the source_executor_id parameter and attribute to executor_id in WorkflowOutputEvent
  • Updated all instantiation sites, pattern matching, and attribute access throughout the codebase
  • Updated TypeScript type definitions and test files to reflect the change

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
python/packages/core/agent_framework/_workflows/_events.py Changed WorkflowOutputEvent constructor parameter and attribute from source_executor_id to executor_id, updated __repr__ method
python/packages/core/agent_framework/_workflows/_workflow_context.py Updated yield_output method to instantiate WorkflowOutputEvent with executor_id parameter
python/packages/core/agent_framework/_workflows/_agent.py Updated pattern matching to use executor_id instead of source_executor_id, updated all references within the match case
python/packages/devui/agent_framework_devui/_mapper.py Changed getattr call to retrieve executor_id instead of source_executor_id, updated logging statement
python/packages/devui/tests/test_mapper.py Updated test instantiations to use executor_id parameter
python/packages/devui/frontend/src/types/agent-framework.ts Updated WorkflowOutputEvent interface to use executor_id property, updated comment on base WorkflowEvent interface
python/samples/getting_started/workflows/control-flow/sequential_streaming.py Updated sample output comment to show executor_id instead of source_executor_id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Introduces changes that are not backward compatible and may require updates to dependent code. python workflows Related to Workflows in agent-framework

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Python: WorkflowOutputEvent does not propagate executor information

3 participants