Skip to content

feat(core): upload files to a chat, and serve them back - #393

Open
davemooreuws wants to merge 1 commit into
mainfrom
chat-attachments
Open

davemooreuws wants to merge 1 commit into
mainfrom
chat-attachments

Conversation

@davemooreuws

@davemooreuws davemooreuws commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

First of seven PRs for chat attachments: storage and routes. Nothing in the web app uses them yet, and attaching an upload to a message comes next.

  • thread_file gains kind, name, uploader_id, message_id and position, in one migration that fills in existing rows as tool results before dropping kind's default. The migration also allows the agent_attachment kind that feat(core): let a bot share a file from its sandbox in its reply #423 uses, so the stack has one migration.
  • POST /chats/:chatId/files?name=…&type=… streams up to 30 MB into the chat's main thread. Without a type, the type comes from the name. A person can have at most 20 uploads not yet sent.
  • GET /chats/:chatId/files/:fileId shows common images in place and offers everything else as a download, with nosniff and Content-Security-Policy: sandbox.
  • An upload can't be read, by people or bots, until it's attached to a message. Uploads never attached are removed after 24 hours.

Part of SUGA-1825

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
sugabots-website dfc6b3f Oct 16 2026, 06:45 AM

tjholm
tjholm previously requested changes Oct 15, 2026
Comment thread packages/core/drizzle/20261014032053_chat_attachments/migration.sql Outdated
Comment thread packages/core/drizzle/20261014032053_chat_attachments/migration.sql
@davemooreuws
davemooreuws requested a review from tjholm October 16, 2026 02:24
@tjholm
tjholm dismissed their stale review October 16, 2026 04:31

original issue addressed

@davemooreuws
davemooreuws force-pushed the chat-attachments branch 2 times, most recently from 2d7ee81 to 59895c6 Compare October 16, 2026 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants