Repository navigation
Save a file a task made to Downloads when it is clicked - #72
Open
abhishek-anand wants to merge 6 commits into
Open
abhishek-anand wants to merge 6 commits into
abhishek-anand wants to merge 6 commits into
Conversation
Clicked, a file in the outputs folder is copied to Downloads like a browser download, then opened there, or shown in Finder when it could run or is an archive. The same file clicked again finds the copy saved before; a different file of that name gets a numbered name. The answer can link it, and the app says where it went.
There was a problem hiding this comment.
🟡 Changes recommended
Concurrent requests can reuse incomplete or incorrect downloads, and byte-identical executable files can be reused without enforcing the non-executable guarantee.
2 open issues
What changed in this PR
Makes task-generated files accessible by saving clicked output links to Downloads before opening or revealing them.
Changes:
- Adds download copying, reuse, and numbered filenames for collisions.
- Shows a save notification and tells the assistant to link generated files.
- Updates gateway coverage and makes the room test adapt to instruction length.
| File | Description |
|---|---|
| tests/test_parallel.py | Sizes the test room from instructions. |
| tests/test_gateway.py | Checks saving, reuse, collisions, and permissions. |
| coderunner/server/web/app/app.js | Displays the Downloads notification. |
| coderunner/server/gateway.py | Saves outputs before opening and returns the saved path. |
| coderunner/files/attached.py | Adds Downloads copying and filename selection. |
| coderunner/agent/loop.py | Instructs the assistant to link downloadable outputs. |
Review effort: Balanced
Comment on lines
+275
to
+276
| with open(target, "xb") as out, open(copy, "rb") as src: | ||
| shutil.copyfileobj(src, out) |
| target = folder / (copy.name if n == 1 else f"{stem} ({n}){suffix}") | ||
| if target.is_symlink(): | ||
| continue | ||
| if target.is_file() and filecmp.cmp(copy, target, shallow=False): |
… never hand back an executable copy The file is copied to a hidden temp file in Downloads first and then linked to its name without overwriting, so a failed copy leaves nothing behind. A same-name file with the same bytes is reused only if it is not executable.
mkagenius
previously approved these changes
Dec 3, 2026
…t be read, and name the saved file when nothing can open it The name is given only by a hard link of the whole copy, so no empty placeholder is ever left in Downloads; a disk without hard links gets a plain error. When the link loses to another click that saved the same bytes, that file is reused. A same-name file that cannot be read counts as someone else's. A missing opener or one that hangs is treated as a failed open, so the reply still says where the file was saved.
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.


Asked for code as a zip, the assistant made one but there was no way to get it: a click on an outputs link opened a hidden copy, and the assistant cannot write to the owner's Mac.
~/Downloadslike a browser download. It then opens there, or is shown in Finder when it could run or is an archive. The copy comes from Open a file a task made from the link in its answer #69's no-follow snapshot and is never executable.name (2).ext, and the file already there is left alone.Tests: gateway test updated (save, reuse, numbered name, never executable); full suite 1272 passing.