Problem
web_fetch with Format: "raw" downloads binary content (images, PDFs) but saves it with a .txt extension and treats it as text. A 2MB PNG becomes a mangled .txt file that attach_file can't deliver to Slack as an image.
Discovered in session D0AC6CKBK5K/1774227325.028479 — user asked to download a blog image and send it back. The image was fetched successfully but saved as headl-1774230585.txt (2MB). The LLM then went silent because it couldn't figure out how to attach a .txt file as an image.
Fix
Check Content-Type response header:
image/* → save with correct extension (.png, .jpg, .gif, .webp)
application/pdf → save as .pdf
- Other binary types → preserve original extension from URL
text/html, text/plain → current behavior (save as .html or .txt)
Impact
Blocks the "download and send back" workflow via Slack. The attach_file tool needs a correctly-typed file to deliver to the channel.
Problem
web_fetchwithFormat: "raw"downloads binary content (images, PDFs) but saves it with a.txtextension and treats it as text. A 2MB PNG becomes a mangled.txtfile thatattach_filecan't deliver to Slack as an image.Discovered in session
D0AC6CKBK5K/1774227325.028479— user asked to download a blog image and send it back. The image was fetched successfully but saved asheadl-1774230585.txt(2MB). The LLM then went silent because it couldn't figure out how to attach a.txtfile as an image.Fix
Check
Content-Typeresponse header:image/*→ save with correct extension (.png,.jpg,.gif,.webp)application/pdf→ save as.pdftext/html,text/plain→ current behavior (save as.htmlor.txt)Impact
Blocks the "download and send back" workflow via Slack. The
attach_filetool needs a correctly-typed file to deliver to the channel.