-
Notifications
You must be signed in to change notification settings - Fork 728
.NET: Fix issue #2181 - Sample type mismatch #2182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
… type mismatch
There was a problem hiding this 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 a type mismatch bug in sample 07_MixedWorkflowAgentsAndExecutors that prevented the workflow from executing end-to-end. The JailbreakSyncExecutor has been updated to accept List<ChatMessage> instead of a single ChatMessage, matching the message collection emitted by the agent host.
- Updated
JailbreakSyncExecutorto inherit fromExecutor<List<ChatMessage>>instead ofExecutor<ChatMessage> - Modified the executor's
HandleAsyncmethod to extract the last assistant message from the list and process it appropriately - Added logic to handle the message collection with proper null-checking using
LastOrDefault
...samples/GettingStarted/Workflows/_Foundational/07_MixedWorkflowAgentsAndExecutors/Program.cs
Outdated
Show resolved
Hide resolved
…WorkflowAgentsAndExecutors/Program.cs Co-authored-by: Copilot <[email protected]>
@microsoft-github-policy-service agree |
Motivation and Context
This change fixes the workflow break in 07_MixedWorkflowAgentsAndExecutors, where the edge from
JailbreakDetectortoJailbreakSyncwas consistently dropped due to a payload type mismatch.The sample defines
JailbreakSyncExecutorasExecutor<ChatMessage>, but the agent host emits a collection of messages (List<ChatMessage>). Because the executor declared a narrower input type, edge delivery failed withdelivery_status: dropped type mismatch, preventing all downstream components (JailbreakSync,ResponseAgent,FinalOutput) from running.Updating the executor to accept
List<ChatMessage>restores compatibility with the emitted payload, allowing the workflow to execute end-to-end as intended.Fixes: #2181
Description
JailbreakSyncExecutorconstructor from:JailbreakDetector → JailbreakSync.StringToChat,JailbreakDetector,JailbreakSync,ResponseAgent, andFinalOutputExecutorall execute correctly.edge_group.delivered = truefor all affected edges.Contribution Checklist