mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Propagate cancellation token down the stack (#1641)
This commit is contained in:
committed by
GitHub
Unverified
parent
0fc1b8837b
commit
e9687d59b4
+1
-1
@@ -73,7 +73,7 @@ internal abstract class DeclarativeActionExecutor : Executor<ActionExecutorResul
|
||||
|
||||
try
|
||||
{
|
||||
object? result = await this.ExecuteAsync(new DeclarativeWorkflowContext(context, this._state), cancellationToken: default).ConfigureAwait(false);
|
||||
object? result = await this.ExecuteAsync(new DeclarativeWorkflowContext(context, this._state), cancellationToken).ConfigureAwait(false);
|
||||
Debug.WriteLine($"RESULT #{this.Id} - {result ?? "(null)"}");
|
||||
|
||||
if (this.EmitResultEvent)
|
||||
|
||||
@@ -75,7 +75,7 @@ public abstract class ActionExecutor<TMessage> : Executor<TMessage>, IResettable
|
||||
/// <inheritdoc/>
|
||||
public override async ValueTask HandleAsync(TMessage message, IWorkflowContext context, CancellationToken cancellationToken)
|
||||
{
|
||||
object? result = await this.ExecuteAsync(new DeclarativeWorkflowContext(context, this._session.State), message, cancellationToken: default).ConfigureAwait(false);
|
||||
object? result = await this.ExecuteAsync(new DeclarativeWorkflowContext(context, this._session.State), message, cancellationToken).ConfigureAwait(false);
|
||||
Debug.WriteLine($"RESULT #{this.Id} - {result ?? "(null)"}");
|
||||
|
||||
await context.SendResultMessageAsync(this.Id, result, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ public static class IWorkflowContextExtensions
|
||||
/// </example>
|
||||
public static async ValueTask<string> FormatTemplateAsync(this IWorkflowContext context, IEnumerable<string> lines, CancellationToken cancellationToken = default)
|
||||
{
|
||||
WorkflowFormulaState state = await context.GetStateAsync(cancellationToken: default).ConfigureAwait(false);
|
||||
WorkflowFormulaState state = await context.GetStateAsync(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
StringBuilder builder = new();
|
||||
foreach (string line in lines)
|
||||
|
||||
Reference in New Issue
Block a user