You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
.NET: [Bug]: Exception in workflow, that is added as agent, results in json serialisation error message instead of exception #8012
var workflowAsAgent = builder
.AddWorkflow("super-agent", CreateWorkflowDelegate)
.AddAsAIAgent(); // Now the workflow can be used as an agent
Error Messages / Stack Traces
Internal (swallowed) exception:
Exception has occurred: CLR/System.InvalidOperationException
Exception thrown: 'System.InvalidOperationException' in Microsoft.Agents.AI.Workflows.dll: 'Executor 'AggregatorExecutor' cannot send messages of type 'MySolution.Workflow.RawAggregate'.'
at Microsoft.Agents.AI.Workflows.InProc.InProcessRunnerContext.<SendMessageAsync>d__30.MoveNext() in /home/vsts/work/1/s/agent-framework/dotnet/src/Microsoft.Agents.AI.Workflows/InProc/InProcessRunnerContext.cs:line 235
What the user sees:
Serialization and deserialization of 'System.Reflection.MethodBase' instances is not supported. Path: $.TargetSite. (Code: execution_error)
🤖 Automated triage reproduction notes(agent-authored — trust but verify)
Agent analysis
The bug is in dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowSession.cs::InvokeStageAsync at lines 538-552, where a WorkflowErrorEvent containing the original Exception is assigned to AgentResponseUpdate.RawRepresentation. It is triggered when a workflow-as-agent throws and a host serializes that raw representation. Minimal repro: run a throwing workflow through AsAIAgent(), select the emitted WorkflowErrorEvent raw representation, and serialize it with System.Text.Json.
Activity
github-actions commentedon Sep 2, 2026
🤖 Automated triage reproduction notes (agent-authored — trust but verify)
Agent analysis
The bug is in dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowSession.cs::InvokeStageAsync at lines 538-552, where a WorkflowErrorEvent containing the original Exception is assigned to AgentResponseUpdate.RawRepresentation. It is triggered when a workflow-as-agent throws and a host serializes that raw representation. Minimal repro: run a throwing workflow through AsAIAgent(), select the emitted WorkflowErrorEvent raw representation, and serialize it with System.Text.Json.
dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/WorkflowHostSmokeTests.cs1.20.0