Skip to content

Commit 136a2ea

Browse files
gwharris7Copilot
andcommitted
Fix CS1998 in PromptForMessagingEndpointAsync
PromptForMessagingEndpointAsync was declared async but contains no await operators (it only performs synchronous console I/O), producing CS1998 introduced by PR 440. Remove the async modifier and return values via Task.FromResult, preserving the Task<string?> signature so the caller's await is unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent a7b7de5 commit 136a2ea

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • src/Microsoft.Agents.A365.DevTools.Cli/Commands/SetupSubcommands

src/Microsoft.Agents.A365.DevTools.Cli/Commands/SetupSubcommands/AllSubcommand.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -960,10 +960,10 @@ internal static async Task ExecuteMessagingEndpointStepAsync(SetupContext ctx)
960960
/// Prompts for the messaging endpoint URL. Returns the entered HTTPS URL, or null to defer
961961
/// (blank entry). The caller prints the section header and opens the indent scope.
962962
/// </summary>
963-
private static async Task<string?> PromptForMessagingEndpointAsync(SetupContext ctx)
963+
private static Task<string?> PromptForMessagingEndpointAsync(SetupContext ctx)
964964
{
965965
if (ctx.NonInteractive)
966-
return null;
966+
return Task.FromResult<string?>(null);
967967

968968
ctx.Logger.LogInformation("The HTTPS URL where your deployed agent receives messages.");
969969
ctx.Logger.LogInformation("Leave blank to configure it later, after you deploy the agent.");
@@ -975,15 +975,15 @@ internal static async Task ExecuteMessagingEndpointStepAsync(SetupContext ctx)
975975
var entered = ConsoleHelper.ReadLineCancellable(ctx.CancellationToken)?.Trim();
976976

977977
if (string.IsNullOrWhiteSpace(entered))
978-
return null;
978+
return Task.FromResult<string?>(null);
979979

980980
if (Uri.TryCreate(entered, UriKind.Absolute, out var uri) && uri.Scheme == Uri.UriSchemeHttps)
981-
return entered;
981+
return Task.FromResult<string?>(entered);
982982

983983
ctx.Logger.LogWarning("Enter a valid HTTPS URL (e.g. https://my-agent.example.com/api/messages), or leave blank to skip.");
984984
}
985985

986-
return null;
986+
return Task.FromResult<string?>(null);
987987
}
988988

989989
/// <summary>

0 commit comments

Comments
 (0)