Repository navigation
feat: send files to Depot agents and chat in attach - #607
Closed
robstolarz wants to merge 15 commits into
Closed
robstolarz wants to merge 15 commits into
robstolarz wants to merge 15 commits into
Conversation
The transcript prints above an input line that stays editable while output streams. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
`--file` (repeatable) on `session create` and `session send`, and `/file <path> [message]` in attach, hash each file locally, upload only the contents Depot does not already store, and send the attachments with the message. The size shows before upload, and a file over the server's limit is refused before anything is uploaded. The transcript names the sender of each user message and queued input, including people on connected services such as Slack, and lists attached files. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… upload Directories send the files git would track, so .gitignore applies; --stdin-file names piped input; media types are sniffed so piped images reach the model as images. Every path is checked against the server's count, per-file and total limits before anything uploads. DEP-7247 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…for every hash Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…input by what the message has left Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ashed, and fit names in 255 bytes Inside a work tree a git failure no longer falls back to a plain walk that would send ignored files. Each file is read once, so a file that changes mid-attach cannot upload under the wrong hash. Flattened names keep their tail and extension. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ders A send that fails after retries leaves attach unable to send while the bad file stays queued, so the chat drops the queue and says so. Subagent reports render as "name (subagent)" like other non-user senders. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ent notices Part of DEP-7247. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NdhqP6oGqJMRJLwBU5Zepm
Linux maps .log to text/x-log; macOS to text/plain. Part of DEP-7247. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NdhqP6oGqJMRJLwBU5Zepm
Matches the API's numbering. Part of DEP-7247. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NdhqP6oGqJMRJLwBU5Zepm
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0f2281f. Configure here.
The system MIME table varies by machine and can label TypeScript as video/mp2t, so the extension is consulted only for bytes the sniffer cannot place. Part of DEP-7247. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NdhqP6oGqJMRJLwBU5Zepm
A .docx still sniffs as a zip and an .svg or .md as text, so the extension's type wins when it refines what the bytes say, and is ignored when it contradicts them. Part of DEP-7247. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NdhqP6oGqJMRJLwBU5Zepm
This was referenced Oct 2, 2026
RTF and other text-based application formats sniff as text, so a text sniff now keeps the extension's type unless it names binary media. Part of DEP-7247. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NdhqP6oGqJMRJLwBU5Zepm
Go sniffs any MP4 container as video/mp4, so .m4a audio lost its type. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NdhqP6oGqJMRJLwBU5Zepm
2 of 3 tasks
This was referenced Oct 3, 2026
Contributor
Author
|
Superseded by #613 in the per-feature Depot agents stack (DEP-7247). Closing. |
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.



Lets
depot agent sessionsend files, directories, piped output and images to an agent, and turnsattachinto a chat whose input stays usable while output streams.createandsendtake--file <path>(repeatable; a file or a directory) and--stdin-file <name>, e.g.some-cmd | depot agent session send <id> --stdin-file out.txt "look at this". Inattach,/file <path> [message]adds a file to the next message..gitignoreapplies, and is refused if git fails inside a work tree; outside one it skips.git. Names are flattened todir_sub_file, with a~Nsuffix to keep them unique, within 255 bytes. Each file is read once, so the upload matches its hash.attachprints the conversation above an editable input line. Each user message names its sender and lists its files.Test plan
go test -race ./pkg/cmd/agent/,golangci-lint run,go vet ./...clean.gitignorehonoured; a piped PNG without an extension sent asimage/png; unique names;/filequeueing and the cumulative limit in attachdepot agent session send <id> --file ./src "review this"andcat shot.png | depot agent session send <id> --stdin-file shot, then confirm the agent sees bothStack, decisions, and deferred / known-open
depot agent sessioncommandsdepot agent pullandpush(on this PR)#608 plugin views is also based on #606.
Decisions made without Rob:
git ls-files --cached --others --exclude-standardinside a work tree, and is refused if git fails there, rather than falling back to sending everything.dir_sub_file, since attachment names are base names; collisions get~N, and long names lose leading characters of the stem to fit 255 bytes..docx, text to any type that isn't image, video, audio or font (.md,.rtf;.svgis allowed), MP4/WebM to an audio type (.m4a), or bytes the sniffer can't place. The system MIME table differs by machine (.tscan map tovideo/mp2t), so text always stays text..pdf, a text file named.wasm) keeps the name's type. The CLI only guarantees that a machine's MIME table cannot relabel a correctly named file.attachkeeps an editable input line while output streams, rather than plain stdin lines.name (kind)for any kind butuser, so a new kind likesubagentneeds no CLI change.Deferred / known-open:
/fileinattachis uploaded at once, and the stored copy is kept for at least 24 hours. If the next message comes after that, the send fails with the API's error instead of re-uploading. The queued files are then dropped and the chat says to/filethem again. Holding the bytes to re-upload would keep up to 64 MiB in memory for the whole chat, for a rare case.🤖 Generated with Claude Code
https://claude.ai/code/session_01NdhqP6oGqJMRJLwBU5Zepm