@@ -18,18 +18,20 @@ internal sealed class WorkflowHostAgent : AIAgent
1818 private readonly string ? _id ;
1919 private readonly CheckpointManager ? _checkpointManager ;
2020 private readonly IWorkflowExecutionEnvironment _executionEnvironment ;
21+ private readonly bool _includeExceptionDetails ;
2122 private readonly Task < ProtocolDescriptor > _describeTask ;
2223
2324 private readonly ConcurrentDictionary < string , string > _assignedRunIds = [ ] ;
2425
25- public WorkflowHostAgent ( Workflow workflow , string ? id = null , string ? name = null , string ? description = null , CheckpointManager ? checkpointManager = null , IWorkflowExecutionEnvironment ? executionEnvironment = null )
26+ public WorkflowHostAgent ( Workflow workflow , string ? id = null , string ? name = null , string ? description = null , CheckpointManager ? checkpointManager = null , IWorkflowExecutionEnvironment ? executionEnvironment = null , bool includeExceptionDetails = false )
2627 {
2728 this . _workflow = Throw . IfNull ( workflow ) ;
2829
2930 this . _executionEnvironment = executionEnvironment ?? ( workflow . AllowConcurrent
3031 ? InProcessExecution . Concurrent
3132 : InProcessExecution . OffThread ) ;
3233 this . _checkpointManager = checkpointManager ;
34+ this . _includeExceptionDetails = includeExceptionDetails ;
3335
3436 this . _id = id ;
3537 this . Name = name ;
@@ -61,10 +63,10 @@ private async ValueTask ValidateWorkflowAsync()
6163 protocol . ThrowIfNotChatProtocol ( ) ;
6264 }
6365
64- public override AgentThread GetNewThread ( ) => new WorkflowThread ( this . _workflow , this . GenerateNewId ( ) , this . _executionEnvironment , this . _checkpointManager ) ;
66+ public override AgentThread GetNewThread ( ) => new WorkflowThread ( this . _workflow , this . GenerateNewId ( ) , this . _executionEnvironment , this . _checkpointManager , this . _includeExceptionDetails ) ;
6567
6668 public override AgentThread DeserializeThread ( JsonElement serializedThread , JsonSerializerOptions ? jsonSerializerOptions = null )
67- => new WorkflowThread ( this . _workflow , serializedThread , this . _executionEnvironment , this . _checkpointManager , jsonSerializerOptions ) ;
69+ => new WorkflowThread ( this . _workflow , serializedThread , this . _executionEnvironment , this . _checkpointManager , this . _includeExceptionDetails , jsonSerializerOptions ) ;
6870
6971 private ValueTask < WorkflowThread > UpdateThreadAsync ( IEnumerable < ChatMessage > messages , AgentThread ? thread = null , CancellationToken cancellationToken = default )
7072 {
0 commit comments