{"record":{"id":"d2f6bc59200bfe76","repo":"microsoft/aspire","slug":"prompt-provided-without-input-data","errorCode":null,"errorMessage":"Prompt provided without input data.","messagePattern":"Prompt provided without input data\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Cli/Commands/PipelineCommandBase.cs","lineNumber":1075,"sourceCode":"\n        // Show StatusText as header (converted from markdown), then Label on new line\n        var convertedHeader = ConvertTextWithMarkdownFlag(header, activityData);\n        var convertedLabel = ConvertTextWithMarkdownFlag(label, activityData);\n        return $\"[bold]{convertedHeader}[/]\\n{convertedLabel}: \";\n    }\n\n    private async Task HandlePromptActivityAsync(PublishingActivity activity, IAppHostCliBackchannel backchannel, CancellationToken cancellationToken)\n    {\n        if (activity.Data.IsComplete)\n        {\n            // Prompt is already completed, nothing to do\n            return;\n        }\n\n        // Check if we have input information\n        if (activity.Data.Inputs is not { Count: > 0 } inputs)\n        {\n            throw new InvalidOperationException(\"Prompt provided without input data.\");\n        }\n\n        // Check for validation errors. If there are errors then this isn't the first time the user has been prompted.\n        var hasValidationErrors = inputs.Any(input => input.ValidationErrors is { Count: > 0 });\n\n        // For multiple inputs, display the activity status text as a header.\n        // Don't display if there are validation errors. Validation errors means the header has already been displayed.\n        if (!hasValidationErrors && inputs.Count > 1)\n        {\n            var headerText = ConvertTextWithMarkdownFlag(activity.Data.StatusText, activity.Data);\n            AnsiConsole.MarkupLine($\"[bold]{headerText}[/]\");\n        }\n\n        // Handle multiple inputs\n        var answers = new PublishingPromptInputAnswer[inputs.Count];\n        for (var i = 0; i < inputs.Count; i++)\n        {\n            var input = inputs[i];","sourceCodeStart":1057,"sourceCodeEnd":1093,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Cli/Commands/PipelineCommandBase.cs#L1057-L1093","documentation":"When the AppHost requests a user prompt during publishing, the CLI renders an interactive prompt from the activity's Data.Inputs collection. If an activity arrives marked as a prompt but carries no input definitions, the CLI cannot construct any prompt UI and throws this InvalidOperationException.","triggerScenarios":"A custom IPublisherActivity/prompt activity posted with an interaction request but Data.Inputs empty or null during `aspire publish`; an AppHost bug where CompleteInteraction/prompt APIs are called without supplying PublishingPromptInput entries.","commonSituations":"Custom publisher or pipeline code that calls the prompt API with no inputs; an AppHost built against an older interaction wire format whose inputs field serializes to empty under a newer CLI.","solutions":["Fix the AppHost/publisher code so every prompt activity supplies at least one input (e.g. a text or select PublishingPromptInput)","Align Aspire.Hosting versions between CLI and AppHost and rebuild","Re-run with a scenario that actually requests input"],"exampleFix":"// before\nInteractionService.PromptAsync(\"Choose env\", inputs: null);\n// after\nInteractionService.PromptAsync(\"Choose env\", inputs: new[] { new PublishingPromptInput { Name = \"env\", InputType = InputType.Text, Required = true } });","handlingStrategy":"validation","validationCode":"if (activity.Data.Inputs is not { Count: > 0 })\n{\n    // AppHost sent a prompt with no inputs; cannot render\n    return;\n}","typeGuard":null,"tryCatchPattern":"try { ShowPrompt(activity); }\ncatch (InvalidOperationException ex) when (ex.Message == \"Prompt provided without input data.\") { Console.Error.WriteLine(\"AppHost sent an empty prompt.\"); }","preventionTips":["Always supply at least one input when creating prompts in publishers","Test interactive publish scenarios before shipping custom publishers","Align interaction wire-format versions between CLI and AppHost"],"tags":["cli","prompt","publishing"],"backgroundTag":"missing-required-argument","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T09:17:21.228Z"}