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

@@ -324,8 +324,13 @@ public partial class ReadFileContent : MSGComponentBase
try
{
var fileContent = await UserFile.LoadFileData(filePath, this.RustService, this.DialogService);
await this.ApplyFileContentAsync(fileContent, filePath);
var extraction = await UserFile.LoadFileData(filePath, this.RustService, this.DialogService);
// The failure was already reported by UserFile.LoadFileData, so we only stop here:
if (!extraction.HasUsableContent)
return false;
await this.ApplyFileContentAsync(extraction.Content, filePath);
this.Logger.LogInformation("Successfully loaded file content: {FilePath}", filePath);
return true;
}