mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
a104d608a3
This change adds support for image attachments to chat via add button and clipboard paste. Files are stored in a new `chat_files` table and referenced by ID in message content. File data is resolved from storage at LLM dispatch time, keeping the message content column small. Upload validates MIME types via content type or content sniffing against an allowlist (png, jpeg, gif, webp). The retrieval endpoint serves files with immutable caching headers. On the frontend, uploads start eagerly on attach with a background fetch to pre-warm the browser HTTP cache so the timeline renders instantly after send.
3 lines
74 B
SQL
3 lines
74 B
SQL
DROP INDEX IF EXISTS idx_chat_files_org;
|
|
DROP TABLE IF EXISTS chat_files;
|