From 205dbab6a065522994225aa2bef230c2059ca211 Mon Sep 17 00:00:00 2001 From: Meleki Date: Fri, 22 May 2026 21:42:40 +0200 Subject: [PATCH] =?UTF-8?q?fix(anthropic-cli):=20PDF-Anh=C3=A4nge=20(type:?= =?UTF-8?q?'document')=20f=C3=BCr=20CLI-Pfad=20akzeptieren?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Frontend sendet PDFs als type:'document'-Block (chat.js), aber ExtractLastUserImageRefs filterte nur 'image' und 'file' → PDFs landeten nie als Temp-Datei im CLI-Workspace und Claude konnte sie nicht per Read-Tool öffnen. --- Services/AnthropicService.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Services/AnthropicService.cs b/Services/AnthropicService.cs index ae7c851..dc84d61 100644 --- a/Services/AnthropicService.cs +++ b/Services/AnthropicService.cs @@ -231,7 +231,9 @@ public partial class AnthropicService foreach (var block in content.EnumerateArray()) { var blockType = block.TryGetProperty("type", out var bt) ? bt.GetString() ?? "" : ""; - if (blockType != "image" && blockType != "file") continue; + // "document" = Frontend-Format für PDFs (chat.js sendet type:'document' für non-image files). + // "file" = Legacy-Alias für Datei-Anhänge. + if (blockType != "image" && blockType != "file" && blockType != "document") continue; var source = block.TryGetProperty("source", out var src) ? src : default; if (source.ValueKind == JsonValueKind.Undefined) continue;