Repository navigation
Replies: 9 comments 1 reply
|
bumping this with a real use case. i run T3 on a VPS and there’s no way to grab files the agent makes (zips, apks, logs) from inside the UI. most of the time i just make the agent send them to me on discord, or scp them, which gets old fast. i’ve got a working patch. it adds a Download action that streams the file to disk with its real name, uses the existing filesystem:read scope, and needs no new permission. i checked it in a real browser and it works. branch is here, kept rebased on main: https://github.com/Ephraim-9/t3code/tree/feat/download-host-files is this direction ok, or should i narrow it (like just the Files panel)? happy to open a PR once someone gives the go-ahead. |
|
+1. Here's the mobile side of this, which the proposal currently leaves out of scope. My use case: I run T3 Code on a Raspberry Pi and drive it from the Android app. The agent builds an APK, and I want to install it on the phone I'm holding. Today, tapping the APK in the chat or the Files panel opens the file viewer, which tries to read it as text and shows:
The underlying cause is If this direction is approved, I'd suggest a narrow mobile follow-up on top of the A few things I checked at
|
|
+1, with one addition: an Open action next to Download, so the file opens in its default app on the device that clicked it. My setup is a Mac Studio running the T3 background service, reached as a saved environment from the desktop app on the same Studio, from a MacBook over Tailscale, and from the iPhone app. Most of what the agent hands me is Office files (xlsx, pptx, docx). Clicking the chat chip opens the files panel, which shows "The file is binary and cannot be displayed as text". Right-click offers only "Copy relative path" and "Copy full path". Download alone still leaves me finding the file in Downloads and opening it. The action I want on a chip is:
Making that the default click for file types the in-app viewer can't render would remove the "binary" dead end. #17981 (closed) asked for a configurable default action for file links, so that setting could hold the choice. Related: #18515 (same-machine saved environments should count as local, which would bring back Reveal in Finder on the Studio itself) and #6894 / #14083 (download from a chat chip, closed without merging). |
|
quick scope proposal so this is easy to say yes or no to. v1 (one PR): download on web and desktop
follow-ups on the same resource (separate PRs, only if wanted)
the branch is rebased on today's main. it typechecks and the touched tests pass: https://github.com/Ephraim-9/t3code/tree/feat/download-host-files @juliusmarminge ok if i open the v1 PR? |
|
+1 to this |
|
I also need this for CSV exports generated on a remote environment. I can preview them in T3 Code but can’t save them to my laptop. The proposed web/desktop download scope would solve my case. Is there anything contributors can do to help get this approved? |
|
Another user story: I run all my agrents in VPS remote. |
|
I assumed it would be automatic but I can't see the references I made to this discussion from #37309 |
|
+1, with a variant for synced folders. My setup: the desktop app on a MacBook drives a T3 server on a Mac mini over Tailscale. Most of what the agents produce are PDFs and Word files saved in a Dropbox folder that is synced on both Macs. So the file already exists on the client, at the same path relative to the Dropbox root, only under a different home directory ( In 0.1.9, a file from the remote environment can't be opened in its default app on the client: Open only builds SSH editor links ( Suggestion, alongside Download/Open: an optional per-environment path mapping in the client settings (server prefix → client prefix). When a file path from that environment falls under a mapped prefix and the mapped file exists on the client, Open and Reveal would act on the client's own copy with the default app; otherwise they would keep today's behaviour, or offer Download. Workaround today: a macOS Quick Action that reads the path copied with "Copy path", rewrites the prefix, checks that the result stays inside the local Dropbox, and opens it with the default app for its file type ( |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Problem
I run T3 Code on a VPS and use it from a browser. The agent produces files there all the time (archives, logs, generated docs, build outputs), and today there is no way to get them onto the device I'm sitting at. The Files panel can browse and preview, and a file's path can be copied, but nothing hands the actual bytes to the client. The workaround is leaving T3 Code for scp/SFTP, which is slow and error-prone when it's needed many times a day.
This is the remote case of #5532 (closed without a change). On a remote or tunneled environment there is no fallback at all, because the file lives on another machine.
Proposal
A Download action for any regular file the environment host can read, reachable from the places a file already appears:
How it works, deliberately small:
file-downloadmember of the existingAssetResourceunion (packages/contracts/src/assets.ts). It carries an absolute path.assets.createUrlRPC and asset route. The claim pins the canonical path; resolving re-canonicalizes and rejects a mismatch, a missing file, a directory, or a tampered token. Files are served withContent-Disposition: attachmentunder their real name, with no preview-type limit.AuthFilesystemReadScope, the same scope that already gates reading files, so no new permission.fileContextMenu.ts, so the entry points above stay consistent.Explicitly out of scope: folder/zip download, a mobile Download button, and anything beyond reading files the environment can already read.
Implementation
I have this working as two commits on top of current
main, with server tests for the claim/resolve rules and a web test for the menu logic: https://github.com/Ephraim-9/t3code/tree/feat/download-host-filesI have not opened a PR, since CONTRIBUTING.md requires explicit maintainer approval of direction and scope for new features first. Happy to open one, rework it (for example, narrowing the entry points), or drop it, whichever you prefer.
Verified in a real browser against a VPS-hosted environment: Download streams the file to disk under its real name. Not yet checked on desktop or mobile clients; I'd add before/after screenshots to a PR if this is approved.
All reactions