Skip to content

Conversation

@lokitoth
Copy link
Member

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

  • 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.

Copilot AI review requested due to automatic review settings October 24, 2025 20:10
@markwallace-microsoft markwallace-microsoft added .NET workflows Related to Workflows in agent-framework labels Oct 24, 2025
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 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

@lokitoth lokitoth force-pushed the dev/dotnet_workflow/fix_orchestrations_and_reset branch from af282c9 to 9b8fb7f Compare October 24, 2025 20:36
@lokitoth lokitoth self-assigned this 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.
@lokitoth lokitoth force-pushed the dev/dotnet_workflow/fix_orchestrations_and_reset branch from 9b8fb7f to 607a678 Compare October 24, 2025 22:06
@lokitoth lokitoth added this pull request to the merge queue Oct 24, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 24, 2025
@crickman crickman added this pull request to the merge queue Oct 24, 2025
Merged via the queue into main with commit 899d8ff Oct 24, 2025
14 checks passed
@crickman crickman deleted the dev/dotnet_workflow/fix_orchestrations_and_reset branch October 27, 2025 16:37
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET workflows Related to Workflows in agent-framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET: Cannot reuse Workflow with shared Executor instances that do not implement IResettableExecutor

7 participants