Repository navigation
feat: attach files and screenshots to tasks and messages - #35
Merged
Merged
Conversation
People can send files with a task, a message or a resume, by id from a new upload endpoint. The bytes live in a new Durable Object per project (FilesObject), in 1 MiB chunks; uploads no message claims are deleted after a day, and deleting a project purges its files like its event logs. Hosts fetch a message's files with the runner token before forwarding it (in order, one fetcher per session) and hand them to fctl-agent as `file` frames. The agent saves them under ~/attachments/<id>/<name>, lists the paths in Claude's turn, and puts images Claude accepts as they are (PNG, JPEG, GIF, WebP up to 2000 px and the API's size limit) into the message itself. Older hosts and agents announce no `attachments` feature; the transcript then says the agent got the message without its files. The CLI gets --attach on run, send and resume; fake-claude reports the files it got so runs can be checked. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Both composers (the floor's new-session box and a session's message box) take files from a paperclip button, a drop anywhere on the page, or a paste (screenshots included; rich text from Word or Excel still pastes as text). Files upload as soon as they are added, with progress, retry and remove; sending waits for uploads still running. The transcript shows a message's images as thumbnails that open full size, and other files as chips that download. Messages may be only files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Agents now quote attachment paths (~/attachments/att_…/name), which have no break opportunities and pushed the transcript wider than a phone's screen. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sessions can be shared with people outside their project; an editor share
can message the agent but could not upload, because uploads were scoped to
the project. Files for a message now go to POST /sessions/{id}/attachments,
which allows exactly who may message the session; the project endpoint
stays for starting sessions. The web composer and fctl send/resume use it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
main moved starting a session into useStartSession and StartButton (one request per start) and added a start form to project pages. Attachments now go through that hook, so the floor and project pages both take files; the agent's prompt test fixture gains task_attachments. Co-Authored-By: Claude Opus 5.5 <[email protected]>
main shipped migration 0004 (session descriptions) and ADR 0007, so the attachments migration becomes 0005_attachments.sql and its ADR 0008. The conflicts were neighbours: imports, tests, fake-claude behaviors, the session columns and docs; both sides are kept. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
fctl-sh Bot
added a commit
that referenced
this pull request
Oct 18, 2026
Conflicts with attachments (#35): - The project_repos migration becomes 0006: 0004 and 0005 have shipped. - The repositories ADR becomes 0009, after attachments' 0008. - fctl-agent's Paths keeps both ~/repos and ~/attachments; a fresh resume sends the task's files and says the other repositories need cloning again. - The project page keeps the attachment imports beside the repository ones. Co-Authored-By: Claude Opus 5.5 <[email protected]>
2 tasks done
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.
People can now attach files to a new session's task and to messages in a session. In the web app, every composer (the floor's, a project page's and a session's) takes files from a paperclip button, a drop anywhere on the page, or a paste, screenshots included. In the CLI,
fctl run,sendandresumetake--attach. The agent finds the files in its sandbox and sees images directly in the message.What changed
Storage (ADR 0008). A new Durable Object per project,
FilesObject, keeps attached files in its SQLite storage in 1 MiB chunks. Durable Objects are already deployed, so instances need no new Cloudflare resources or deploy-token permissions; the class arrives with av2Durable Object migration. Uploads that no message claims are deleted after a day. Deleting a project, directly or with an account, queues its files infile_purges, alongside the existingsession_purges.API.
POST /api/v1/projects/{id}/attachments(to start a session) andPOST /api/v1/sessions/{id}/attachments(a message in one, for anyone who may message it, including people the session is shared with). The body is the raw file asapplication/octet-stream, passed through the Worker unread. It isn't JSON, but browsers can't send it cross-site without a preflight, and it gets the usual origin check.CreateSessionRequest,SendMessageRequest,ResumeSessionRequestand the viewer socket'ssendtakeattachments: [id]. Sending claims the uploads for the session: they must be the sender's and not sent in another session. A message may be only files.GET /api/v1/sessions/{id}/attachments/{attachment}for the session's viewers, andGET /api/v1/runner/sessions/{id}/attachments/{attachment}for the runner it is assigned to. Files are served withnosniff,Cross-Origin-Resource-Policy: same-originand a sandboxing CSP. Only PNG, JPEG, GIF and WebP display in place; everything else downloads.Host and agent.
fileframes.~/attachments/<id>/<name>, outside the repository, and lists the paths after the message text.Compatibility. Every protocol change is an optional field or a new frame type.
attachmentsfeature in their uplink hello. With an older host, the transcript says the agent got the message without its files and to runfctl self update.Web.
useStartSessionhook, which now takes the files.Docs: architecture, CLI, getting started, security and development pages, plus ADR 0008. D1 migration:
0005_attachments.sql.Before merging
legal/privacy.mdneeds a matching change (that repository isn't reachable from this session). app.fctl.sh now stores the files people attach to messages, in Cloudflare Durable Objects, with their project, until the project is deleted; uploads never sent are deleted after a day. They go to the runner host that runs the session and into its sandbox, and Anthropic receives images shown in a message and any file the agent reads.How I verified it
Content-Disposition, validation, titles, base64 omission. fctl-agent: saving, the file list, the inline budget. Web: paste rules, pasted-image names, sizes.cargo fmt --check, clippy (workspace andwasm32control plane), all Rust tests (84), and Biome,tscand Vitest (20) for the web app.file_purges.Not done here
fctl account exportlists attachments in its transcripts but not their bytes. security.md now says each file downloads from its session; including them could be a follow-up.Made in fctl session https://app.fctl.sh/s/ses_01M564K7K8ZR6T9W1S8MH43WA9