diff --git a/.changeset/remote-file-access.md b/.changeset/remote-file-access.md new file mode 100644 index 00000000..b5ef3492 --- /dev/null +++ b/.changeset/remote-file-access.md @@ -0,0 +1,27 @@ +--- +"aicodeman": patch +--- + +File previews, downloads and text reads now work in a **remote (SSH) case**. + +A remote case's working directory is an absolute path on the *remote* host, but the +file routes resolved it with local `fs` — so a clicked path (or the File Viewer) always +failed as "File not found" even though the file existed and the session was clearly +working in that directory. `GET /api/sessions/:id/file-raw`, `file-content`, +`file-preview` and `file-thumbnail` now resolve and read through the same +`buildSshConnectionArgs()` connection the launch uses (`src/remote-files.ts`, one +`realpath`+`stat` probe per request returning both the file and the workspace root). + +The guards are unchanged in strength: the workspace boundary is still enforced (now +resolved on the host that can actually resolve it), the sensitive-path blocklist and +the size cap (`CODEMAN_MAX_DOWNLOAD_BYTES`) still apply before any bytes are read, and +`Range` requests keep working, so remote `