fix(anthropic-cli): PDF-Anhänge (type:'document') für CLI-Pfad akzeptieren
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.
This commit is contained in:
1 parent
1c9b6e3e63
commit
205dbab6a0
1 file changed
+3
-1
@@ -231,7 +231,9 @@ public partial class AnthropicService
|
|||||||
foreach (var block in content.EnumerateArray())
|
foreach (var block in content.EnumerateArray())
|
||||||
{
|
{
|
||||||
var blockType = block.TryGetProperty("type", out var bt) ? bt.GetString() ?? "" : "";
|
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;
|
var source = block.TryGetProperty("source", out var src) ? src : default;
|
||||||
if (source.ValueKind == JsonValueKind.Undefined) continue;
|
if (source.ValueKind == JsonValueKind.Undefined) continue;
|
||||||
|
|||||||
Reference in new issue
Block a user