.NET: Clean up some CancellationToken usage (#996)

* Clean up some CancellationToken usage

* Unused usings
This commit is contained in:
Stephen Toub
2025-09-30 09:44:53 -04:00
committed by GitHub
Unverified
parent 53eb48968d
commit 4fd61924fc
35 changed files with 191 additions and 191 deletions
@@ -99,8 +99,8 @@ internal abstract class DeclarativeActionExecutor : Executor<ActionExecutorResul
/// Restore the state of the executor from a checkpoint.
/// This must be overridden to restore any state that was saved during checkpointing.
/// </summary>
protected override ValueTask OnCheckpointRestoredAsync(IWorkflowContext context, CancellationToken cancellation = default) =>
this._state.RestoreAsync(context, cancellation);
protected override ValueTask OnCheckpointRestoredAsync(IWorkflowContext context, CancellationToken cancellationToken = default) =>
this._state.RestoreAsync(context, cancellationToken);
protected async ValueTask AssignAsync(PropertyPath? targetPath, FormulaValue result, IWorkflowContext context)
{
@@ -16,14 +16,14 @@ public abstract class WorkflowAgentProvider
/// Asynchronously retrieves an AI agent by its unique identifier.
/// </summary>
/// <param name="agentId">The unique identifier of the AI agent to retrieve. Cannot be null or empty.</param>
/// <param name="cancellationToken">A cancellation token that can be used to cancel the operation.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
/// <returns>The task result contains the <see cref="AIAgent"/> associated.</returns>
public abstract Task<AIAgent> GetAgentAsync(string agentId, CancellationToken cancellationToken = default);
/// <summary>
/// Asynchronously creates a new conversation and returns its unique identifier.
/// </summary>
/// <param name="cancellationToken">A cancellation token that can be used to cancel the operation.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
/// <returns>The conversation identifier</returns>
public abstract Task<string> CreateConversationAsync(CancellationToken cancellationToken = default);
@@ -32,7 +32,7 @@ public abstract class WorkflowAgentProvider
/// </summary>
/// <param name="conversationId">The identifier of the target conversation.</param>
/// <param name="conversationMessage">The message being added.</param>
/// <param name="cancellationToken">A cancellation token that can be used to cancel the operation.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
public abstract Task CreateMessageAsync(string conversationId, ChatMessage conversationMessage, CancellationToken cancellationToken = default);
/// <summary>
@@ -40,7 +40,7 @@ public abstract class WorkflowAgentProvider
/// </summary>
/// <param name="conversationId">The identifier of the target conversation.</param>
/// <param name="messageId">The identifier of the target message.</param>
/// <param name="cancellationToken">A cancellation token that can be used to cancel the operation.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
/// <returns>The requested message</returns>
public abstract Task<ChatMessage> GetMessageAsync(string conversationId, string messageId, CancellationToken cancellationToken = default);
@@ -52,7 +52,7 @@ public abstract class WorkflowAgentProvider
/// <param name="after">A cursor for use in pagination. after is an object ID that defines your place in the list.</param>
/// <param name="before">A cursor for use in pagination. before is an object ID that defines your place in the list.</param>
/// <param name="newestFirst">Provide records in descending order when true.</param>
/// <param name="cancellationToken">A cancellation token that can be used to cancel the operation.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
/// <returns>The requested messages</returns>
public abstract IAsyncEnumerable<ChatMessage> GetMessagesAsync(
string conversationId,