Skip to content
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
84c7de9
adds support for labels in edges, fixes rendering of labels in dot a…
joslat Oct 16, 2025
e2dbb6f
Update dotnet/src/Microsoft.Agents.AI.Workflows/Visualization/Workflo…
joslat Oct 16, 2025
e94ec7a
escaping edge labels, adding tests for labels containing strange char…
joslat Oct 16, 2025
32479b8
Unify label in EdgeData
joslat Nov 2, 2025
4f6b6fb
Edge API adjustments, removed useless "sanitizer"
joslat Nov 2, 2025
5021f74
Merge branch 'main' into joslat-Add-labels-to-Edges
lokitoth Nov 11, 2025
e513440
Merge branch 'main' into joslat-Add-labels-to-Edges
lokitoth Nov 12, 2025
aada7fc
Merge branch 'main' into joslat-Add-labels-to-Edges
joslat Nov 14, 2025
1b0f75e
Merge branch 'main' into joslat-Add-labels-to-Edges
crickman Nov 17, 2025
9655eaf
Merge branch 'main' into joslat-Add-labels-to-Edges
joslat Nov 25, 2025
331f4aa
Merge branch 'main' into joslat-Add-labels-to-Edges
joslat Nov 28, 2025
a206129
Merge branch 'main' into joslat-Add-labels-to-Edges
joslat Dec 3, 2025
c3bbb24
Merge branch 'main' into joslat-Add-labels-to-Edges
joslat Dec 3, 2025
455857d
Merge branch 'main' into joslat-Add-labels-to-Edges
joslat Dec 3, 2025
98d9733
Merge branch 'main' into joslat-Add-labels-to-Edges
joslat Dec 5, 2025
a104f84
Merge branch 'main' into joslat-Add-labels-to-Edges
crickman Dec 10, 2025
bf7aac0
Merge branch 'main' into joslat-Add-labels-to-Edges
joslat Dec 10, 2025
ecd2fa2
fixed test
joslat Dec 10, 2025
c45e13f
Fix in Sample
joslat Jan 17, 2026
f53868a
Merge branch 'main' into joslat-fix-sample-issue
joslat Jan 17, 2026
6517a24
update
joslat Jan 17, 2026
bd65d19
Merge branch 'joslat-fix-sample-issue' of https://github.com/joslat/a…
joslat Jan 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private static async Task Main()
private static async Task ExecuteWorkflowAsync(Workflow workflow, string input)
{
// Configure whether to show agent thinking in real-time
const bool ShowAgentThinking = false;
const bool ShowAgentThinking = true;

// Execute in streaming mode to see real-time progress
await using StreamingRun run = await InProcessExecution.StreamAsync(workflow, input);
Expand Down Expand Up @@ -230,14 +230,23 @@ public override async ValueTask HandleAsync(string message, IWorkflowContext con
/// Executor that synchronizes agent output and prepares it for the next stage.
/// This demonstrates how executors can process agent outputs and forward to the next agent.
/// </summary>
internal sealed class JailbreakSyncExecutor() : Executor<ChatMessage>("JailbreakSync")
/// <remarks>
/// The AIAgentHostExecutor sends response.Messages which has runtime type List&lt;ChatMessage&gt;.
/// The message router uses exact type matching via message.GetType().
/// </remarks>
internal sealed class JailbreakSyncExecutor() : Executor<List<ChatMessage>>("JailbreakSync")
{
public override async ValueTask HandleAsync(ChatMessage message, IWorkflowContext context, CancellationToken cancellationToken = default)
public override async ValueTask HandleAsync(List<ChatMessage> message, IWorkflowContext context, CancellationToken cancellationToken = default)
{
Console.WriteLine(); // New line after agent streaming
Console.ForegroundColor = ConsoleColor.Magenta;

string fullAgentResponse = message.Text?.Trim() ?? "UNKNOWN";
// Combine all response messages (typically just one for simple agents)
string fullAgentResponse = string.Join("\n", message.Select(m => m.Text?.Trim() ?? "")).Trim();
if (string.IsNullOrEmpty(fullAgentResponse))
{
fullAgentResponse = "UNKNOWN";
}

Console.WriteLine($"[{this.Id}] Full Agent Response:");
Console.WriteLine(fullAgentResponse);
Expand Down Expand Up @@ -278,17 +287,24 @@ public override async ValueTask HandleAsync(ChatMessage message, IWorkflowContex
/// <summary>
/// Executor that outputs the final result and marks the end of the workflow.
/// </summary>
internal sealed class FinalOutputExecutor() : Executor<ChatMessage, string>("FinalOutput")
/// <remarks>
/// The AIAgentHostExecutor sends response.Messages which has runtime type List&lt;ChatMessage&gt;.
/// The message router uses exact type matching via message.GetType().
/// </remarks>
internal sealed class FinalOutputExecutor() : Executor<List<ChatMessage>, string>("FinalOutput")
{
public override ValueTask<string> HandleAsync(ChatMessage message, IWorkflowContext context, CancellationToken cancellationToken = default)
public override ValueTask<string> HandleAsync(List<ChatMessage> message, IWorkflowContext context, CancellationToken cancellationToken = default)
{
// Combine all response messages (typically just one for simple agents)
string combinedText = string.Join("\n", message.Select(m => m.Text ?? "")).Trim();

Console.WriteLine(); // New line after agent streaming
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine($"\n[{this.Id}] Final Response:");
Console.WriteLine($"{message.Text}");
Console.WriteLine($"{combinedText}");
Console.WriteLine("\n[End of Workflow]");
Console.ResetColor();

return ValueTask.FromResult(message.Text ?? string.Empty);
return ValueTask.FromResult(combinedText);
}
}