.NET: Fix Concurrency Support for Orchestrations#1689
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes concurrency support for orchestration workflows by addressing gaps in cross-run shareability declarations and correcting the reset logic. The key changes ensure that stateless executors are properly marked as cross-run shareable, and workflows can correctly reset when needed.
Key Changes
- Marks multiple stateless specialized executors as cross-run shareable (CollectChatMessagesExecutor, HandoffStartExecutor, HandoffAgentExecutor, HandoffEndExecutor, OutputMessagesExecutor)
- Switches ConcurrentEndExecutor from shared instance to factory-based registration to enable cross-run shareability
- Fixes reset logic to properly handle workflows with only cross-run shareable executors
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| TestEchoAgent.cs | New test helper agent that echoes messages with optional prefix |
| SampleSmokeTest.cs | Adds tests for new orchestration patterns (Steps 10-12) and updates existing tests to support multiple execution environments |
| 12_HandOff_HostAsAgent.cs | New sample demonstrating handoff workflow with host agent pattern |
| 11_Concurrent_HostAsAgent.cs | New sample demonstrating concurrent workflow with host agent pattern |
| 10_Sequential_HostAsAgent.cs | New sample demonstrating sequential workflow with host agent pattern |
| 07_GroupChat_Workflow_HostAsAgent.cs | Updated to use new execution environment parameter |
| 06_GroupChat_Workflow.cs | Refactored to use TestEchoAgent and removed EchoAgent implementation |
| AgentWorkflowBuilderTests.cs | Updated to parameterize execution environment in workflow tests |
| Workflow.cs | Fixed reset logic to check for resettable executors instead of non-resettable ones |
| OutputMessagesExecutor.cs | Marked as cross-run shareable |
| HandoffsStartExecutor.cs | Marked as cross-run shareable and added executor ID constant |
| HandoffsEndExecutor.cs | Marked as cross-run shareable |
| HandoffAgentExecutor.cs | Marked as cross-run shareable |
| ConcurrentEndExecutor.cs | Added executor ID constant for factory-based registration |
| CollectChatMessagesExecutor.cs | Marked as cross-run shareable |
| ExecutorRegistration.cs | Refactored reset/concurrent support logic and improved documentation |
| AgentWorkflowBuilder.cs | Changed ConcurrentEndExecutor to factory-based registration |
af282c9 to
9b8fb7f
Compare
alliscode
reviewed
Oct 24, 2025
alliscode
approved these changes
Oct 24, 2025
Concurrent run support was recently added to workflows, but Orchestrations did not fully update to support it. A few executors were missing Cross-Run Shareable annotations, and the ConcurrentEnd executor needed to be factory-instantiated. This also ports the fix for #1613 from #1637, to avoid waiting on that PR.
9b8fb7f to
607a678
Compare
peibekwe
approved these changes
Oct 24, 2025
TaoChenOSU
approved these changes
Oct 24, 2025
ReubenBond
pushed a commit
to ReubenBond/agent-framework
that referenced
this pull request
Oct 28, 2025
Concurrent run support was recently added to workflows, but Orchestrations did not fully update to support it. A few executors were missing Cross-Run Shareable annotations, and the ConcurrentEnd executor needed to be factory-instantiated. This also ports the fix for microsoft#1613 from microsoft#1637, to avoid waiting on that PR.
arisng
pushed a commit
to arisng/agent-framework
that referenced
this pull request
Feb 2, 2026
Concurrent run support was recently added to workflows, but Orchestrations did not fully update to support it. A few executors were missing Cross-Run Shareable annotations, and the ConcurrentEnd executor needed to be factory-instantiated. This also ports the fix for microsoft#1613 from microsoft#1637, to avoid waiting on that PR.
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
Concurrent-Shared run support was recently added to workflows, but Orchestrations did not fully update to support it. As well, the logic around resetting was flawed, causing workflows consisting only of Cross-Run Shareable executor registrations to fail to reset properly.
Description
Contribution Checklist