From 136a2ea5347038ff39a9b494246683f5633cc193 Mon Sep 17 00:00:00 2001 From: Grant Harris <96964444+gwharris7@users.noreply.github.com> Date: Thu, 4 Jun 2026 10:45:17 -0700 Subject: [PATCH] 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 signature so the caller's await is unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Commands/SetupSubcommands/AllSubcommand.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Microsoft.Agents.A365.DevTools.Cli/Commands/SetupSubcommands/AllSubcommand.cs b/src/Microsoft.Agents.A365.DevTools.Cli/Commands/SetupSubcommands/AllSubcommand.cs index 179e82b8..e0afcc50 100644 --- a/src/Microsoft.Agents.A365.DevTools.Cli/Commands/SetupSubcommands/AllSubcommand.cs +++ b/src/Microsoft.Agents.A365.DevTools.Cli/Commands/SetupSubcommands/AllSubcommand.cs @@ -960,10 +960,10 @@ internal static async Task ExecuteMessagingEndpointStepAsync(SetupContext ctx) /// Prompts for the messaging endpoint URL. Returns the entered HTTPS URL, or null to defer /// (blank entry). The caller prints the section header and opens the indent scope. /// - private static async Task PromptForMessagingEndpointAsync(SetupContext ctx) + private static Task PromptForMessagingEndpointAsync(SetupContext ctx) { if (ctx.NonInteractive) - return null; + return Task.FromResult(null); ctx.Logger.LogInformation("The HTTPS URL where your deployed agent receives messages."); 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) var entered = ConsoleHelper.ReadLineCancellable(ctx.CancellationToken)?.Trim(); if (string.IsNullOrWhiteSpace(entered)) - return null; + return Task.FromResult(null); if (Uri.TryCreate(entered, UriKind.Absolute, out var uri) && uri.Scheme == Uri.UriSchemeHttps) - return entered; + return Task.FromResult(entered); ctx.Logger.LogWarning("Enter a valid HTTPS URL (e.g. https://my-agent.example.com/api/messages), or leave blank to skip."); } - return null; + return Task.FromResult(null); } ///