Repository navigation
Attach files to messages: paste, + button, or drag and drop - #3
Merged
Merged
Conversation
People can now paste a screenshot or file, pick files with a new + button, or drop files on the window. Files upload to the local service and are kept in the room's workspace/attachments folder, beside the transcript archive agents already read. Each agent's prompt and room-history.jsonl list every attached file's absolute path, so any provider can open it with its own tools. Images show inline in the chat and open full size; other files download and never render in the app. Names are cleaned so they are valid on Windows and macOS, IDs never become paths unchecked, and files are capped at 50 MB each and 20 per message. Old rooms gain the new column through an additive migration. Works the same in the Electron shell on both OSes and in a browser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lets people attach screenshots, images, PDFs and any other file to a message, the way OpenMontage Studio attaches references (a + button and drag-and-drop), plus pasting from the clipboard. Agents are told where each file is saved so they can open it.
Related issue
None.
Changes
core/room.py): uploads are saved to<room>/workspace/attachments/<id>/<cleaned name>, besideroom-history.jsonl. Names are made safe on Windows and macOS, and an ID must be 32 hex characters before it is used in a path. Limits are 50 MB per file and 20 per message. A newmessages.attachmentscolumn is added through an additive migration. Messages without files look exactly as before in state, the archive and prompts.core/prompt.py): each message's JSON line lists{name, type, path}for its files. When any file is present, one extra sentence tells the agent to open them with its own tools.server.py):POST /api/attachmentsaccepts raw bytes with anX-Filenameheader.GET /api/attachments/<id>serves PNG, JPEG, GIF, WebP and BMP inline. Every other type is served as anapplication/octet-streamdownload withdefault-src 'none'./api/messagesacceptsattachments: [id].docs/ARCHITECTURE.mdcovers the new routes and fields.Notes for reviewers
desktop/.Testing
py -3 -m pytest tests -q(146 passed, 1 skipped). New tests cover the upload, send and serve round trip, files-only messages, prompt and archive paths, cleaned names, path-traversal IDs, empty files, and a room created before this change.npm test(indesktop/) was not run because nothing indesktop/changed.--datafolder. I checked paste, the + button, drag-and-drop, sending, the full-size image view and dark mode, and confirmed the files and the archive entries on disk. macOS has not been checked by hand.Checklist
--data), not my real chats.signing.local.ps1, local config, databases) are included in the diff.🤖 Generated with Claude Code