.NET: BREAKING: Unify AgentResponse[Update] events as WorkflowOutputEvents#3441
Open
.NET: BREAKING: Unify AgentResponse[Update] events as WorkflowOutputEvents#3441
AgentResponse[Update] events as WorkflowOutputEvents#3441Conversation
Contributor
There was a problem hiding this comment.
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.SourceIdtoExecutorIdwith obsolete forwarding property for backward compatibility - Changed
AgentResponseUpdateEventandAgentResponseEventto inherit fromWorkflowOutputEventinstead ofExecutorEvent - Updated executors to use
YieldOutputAsync()instead of directly callingAddEventAsync()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
| File | Description |
|---|---|
WorkflowOutputEvent.cs |
Changed class from sealed to non-sealed, renamed property SourceId to ExecutorId with obsolete forwarding, made constructor public, added JSON derived type attributes |
AgentResponseUpdateEvent.cs |
Changed base class from ExecutorEvent to WorkflowOutputEvent |
AgentResponseEvent.cs |
Changed base class from ExecutorEvent to WorkflowOutputEvent |
AIAgentHostExecutor.cs |
Updated to call YieldOutputAsync() instead of AddEventAsync() for agent events |
HandoffAgentExecutor.cs |
Updated to call YieldOutputAsync() instead of AddEventAsync() for agent events |
InProcessRunnerContext.cs |
Added special-case handling for AgentResponse and AgentResponseUpdate to create their specific event types |
TestWorkflowContext.cs |
Added special-case handling consistent with InProcessRunnerContext |
TestRunContext.cs |
Added special-case handling consistent with InProcessRunnerContext |
AgentEventsTests.cs |
New test file verifying the inheritance changes and regression test for issue #2938 |
| Sample test files | Updated references from SourceId to ExecutorId |
2332d2e to
3fe658a
Compare
3fe658a to
42a9908
Compare
42a9908 to
a8f2e72
Compare
a8f2e72 to
f2093fe
Compare
f2093fe to
ecc489a
Compare
ecc489a to
07b924f
Compare
07b924f to
b0e7302
Compare
cfca03f to
cc883d5
Compare
cc883d5 to
8cd4b9a
Compare
8cd4b9a to
0f72493
Compare
0f72493 to
bc31a5c
Compare
bc31a5c to
9bee90f
Compare
- Rename SourceId property to ExecutorId in WorkflowOutputEvent - Add [Obsolete] SourceId property for backward compatibility - Update all test usages to use ExecutorId Resolves part of #2938
- Change AgentResponseEvent and AgentResponseUpdateEvent to inherit from WorkflowOutputEvent instead of ExecutorEvent - Update AIAgentHostExecutor and HandoffAgentExecutor to use YieldOutputAsync() instead of AddEventAsync() for agent outputs - Add special-casing in InProcessRunnerContext.YieldOutputAsync() to create specific event types for AgentResponse and AgentResponseUpdate, bypassing OutputFilter for backwards compatibility - Update TestRunContext and TestWorkflowContext with same special-casing - Add regression tests in AgentEventsTests
9bee90f to
ed0e7d7
Compare
SergeyMenshykh
approved these changes
Feb 13, 2026
westey-m
reviewed
Feb 13, 2026
Comment on lines
+236
to
+237
| // and bypass the output filter (for backwards compatibility - these events were previously | ||
| // emitted directly via AddEventAsync without filtering) |
Contributor
There was a problem hiding this comment.
Do we need backwards compatibility at this stage?
westey-m
approved these changes
Feb 13, 2026
alliscode
approved these changes
Feb 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
The streaming
AgentResponseUpdateand fullAgentResponseevents were added before theWorkflowOutputEventmechanism 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
WorkflowOutputEvent.SourceIdtoWorkflowOutputEvent.ExecutorIdSourceIdforwarding toExecutorIdonWorkflowOutputEventAgentResponseUpdateEventandAgentResponseEventto derive fromWorkflowOutputEventto unify handlingBREAKING CHANGES:
WorkflowOutputEvent.SourceIdtoWorkflowOutputEvent.ExecutorIdContribution Checklist