Fixed attached files silently reaching the AI as empty documents (#904)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-08-10 16:37:44 +02:00
1 parent b9ec13edcf
commit 8f8f788896
31 files changed
+1730 -285

No files matched your search

@@ -579,9 +579,10 @@ public partial class AssistantPromptOptimizer : AssistantBaseCore<SettingsDialog
try
{
this.isLoadingCustomPromptGuide = true;
this.customPromptingGuidelineContent = await UserFile.LoadFileData(fileAttachment.FilePath, this.RustService, this.DialogService);
if (string.IsNullOrWhiteSpace(this.customPromptingGuidelineContent))
await this.MessageBus.SendWarning(new(Icons.Material.Filled.Description, T("The custom prompt guide file is empty or could not be read.")));
// A failure was already reported by UserFile.LoadFileData, so we only keep the content:
var extraction = await UserFile.LoadFileData(fileAttachment.FilePath, this.RustService, this.DialogService);
this.customPromptingGuidelineContent = extraction.HasUsableContent ? extraction.Content : string.Empty;
}
catch
{