Add generic file attachments to chat messages

Messages can now carry an arbitrary file (MessageFile), parallel to the
existing MessageImage feature rather than a refactor of it. Files serve
with Content-Disposition: attachment to force a download and prevent an
uploaded HTML/SVG from executing same-origin. No content-type allowlist,
same 8MB cap as images for now (a separate size-limit redesign is tracked
as its own issue).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
ksmithandClaude Sonnet 5 committed 2026-08-15 08:02:55 -06:00
1 parent 89be497fdb
commit c78d7454b6
21 files changed
+697 -55

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
import uuid
from pydantic import BaseModel
class MessageFileCreated(BaseModel):
id: uuid.UUID
filename: str
size_bytes: int
content_type: str