Skip to content

.NET: BREAKING: Unify AgentResponse[Update] events as WorkflowOutputEvents - #3441

Merged
Jacob Alber (lokitoth) merged 3 commits into
mainfrom
dev/dotnet_workflow/unify_agent_response_event_in_output
Feb 18, 2026
Merged

.NET: BREAKING: Unify AgentResponse[Update] events as WorkflowOutputEvents#3441
Jacob Alber (lokitoth) merged 3 commits into
mainfrom
dev/dotnet_workflow/unify_agent_response_event_in_output

Conversation

@lokitoth

Copy link
Copy Markdown
Contributor

Motivation and Context

The streaming AgentResponseUpdate and full AgentResponse events were added before the WorkflowOutputEvent mechanism was formalized, leading to a pair of vestigial events that cause confusion for users.

Reconciling the two will make it clearer how to listen to Workflow outputs, though we special-case it to continue avoiding the output filtering logic, via WithOutputFrom().

Description

  • Python-parity: Breaking: Renames WorkflowOutputEvent.SourceId to WorkflowOutputEvent.ExecutorId
  • Adds [Obsolete] SourceId forwarding to ExecutorId on WorkflowOutputEvent
  • Changes AgentResponseUpdateEvent and AgentResponseEvent to derive from WorkflowOutputEvent to unify handling
  • Fixes.NET : Agents in Workflow. WorkflowOutputEvent not triggered #2938

BREAKING CHANGES:

  • Rename WorkflowOutputEvent.SourceId to WorkflowOutputEvent.ExecutorId

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.

@lokitothJacob Alber (lokitoth) added the .NET Usage: [Issues, PRs], Target: .Net label Jan 26, 2026
CopilotAI review requested due to automatic review settings January 26, 2026 16:33
@lokitothJacob Alber (lokitoth) added workflows Usage: [Issues, PRs], Target: Workflows breaking change Usage: [PRs], Target: all PRs that introduce changes that are not backward compatible labels Jan 26, 2026

CopilotAI 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 unifies agent response events under the WorkflowOutputEvent hierarchy to address confusion about how to listen to workflow outputs from agents. The change makes AgentResponseUpdateEvent and AgentResponseEvent derive from WorkflowOutputEvent instead of ExecutorEvent, and renames WorkflowOutputEvent.SourceId to ExecutorId for Python parity.

Changes:

  • Renamed WorkflowOutputEvent.SourceId to ExecutorId with obsolete forwarding property for backward compatibility
  • Changed AgentResponseUpdateEvent and AgentResponseEvent to inherit from WorkflowOutputEvent instead of ExecutorEvent
  • Updated executors to use YieldOutputAsync() instead of directly calling AddEventAsync() for agent events, ensuring consistent special-case handling

Reviewed changes

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

Show a summary per file
FileDescription
WorkflowOutputEvent.csChanged class from sealed to non-sealed, renamed property SourceId to ExecutorId with obsolete forwarding, made constructor public, added JSON derived type attributes
AgentResponseUpdateEvent.csChanged base class from ExecutorEvent to WorkflowOutputEvent
AgentResponseEvent.csChanged base class from ExecutorEvent to WorkflowOutputEvent
AIAgentHostExecutor.csUpdated to call YieldOutputAsync() instead of AddEventAsync() for agent events
HandoffAgentExecutor.csUpdated to call YieldOutputAsync() instead of AddEventAsync() for agent events
InProcessRunnerContext.csAdded special-case handling for AgentResponse and AgentResponseUpdate to create their specific event types
TestWorkflowContext.csAdded special-case handling consistent with InProcessRunnerContext
TestRunContext.csAdded special-case handling consistent with InProcessRunnerContext
AgentEventsTests.csNew test file verifying the inheritance changes and regression test for issue #2938
Sample test filesUpdated references from SourceId to ExecutorId

@lokitoth
Jacob Alber (lokitoth)force-pushed the dev/dotnet_workflow/unify_agent_response_event_in_output branch from 2332d2e to 3fe658aCompareJanuary 26, 2026 16:58
@lokitoth
Jacob Alber (lokitoth)force-pushed the dev/dotnet_workflow/unify_agent_response_event_in_output branch from 3fe658a to 42a9908CompareJanuary 26, 2026 17:15
@lokitoth
Jacob Alber (lokitoth)force-pushed the dev/dotnet_workflow/unify_agent_response_event_in_output branch from 42a9908 to a8f2e72CompareJanuary 26, 2026 18:55
@lokitoth
Jacob Alber (lokitoth)force-pushed the dev/dotnet_workflow/unify_agent_response_event_in_output branch from a8f2e72 to f2093feCompareJanuary 27, 2026 21:41
@lokitoth
Jacob Alber (lokitoth)force-pushed the dev/dotnet_workflow/unify_agent_response_event_in_output branch from f2093fe to ecc489aCompareJanuary 27, 2026 23:41
@lokitoth
Jacob Alber (lokitoth)force-pushed the dev/dotnet_workflow/unify_agent_response_event_in_output branch from ecc489a to 07b924fCompareFebruary 4, 2026 18:05
@lokitoth
Jacob Alber (lokitoth)force-pushed the dev/dotnet_workflow/unify_agent_response_event_in_output branch from 07b924f to b0e7302CompareFebruary 4, 2026 18:23
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking changeUsage: [PRs], Target: all PRs that introduce changes that are not backward compatible.NETUsage: [Issues, PRs], Target: .NetworkflowsUsage: [Issues, PRs], Target: Workflows

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

.NET : Agents in Workflow. WorkflowOutputEvent not triggered

5 participants

@lokitoth@alliscode@SergeyMenshykh@westey-m