Repository navigation
sandbox upload creates a directory instead of a file when source is inside a git repository #1740
Description
Activity
- addedstate:triage-neededOpened without agent diagnostics and needs triageOpened without agent diagnostics and needs triage
on Jun 4, 2026 📋 triage-agent
Triage Assessment
Classification:
bug-confirmedSummary
Git-aware single-file uploads still violate the CLI's documented cp/scp-style destination semantics on current
main. This is distinct from the earlier general upload fix (#694) and symlink fix (#1595), and no open fix PR was found.Investigation
A regular file inside a Git repository is routed through
git_sync_files()andsandbox_sync_up_files(). The Git filter correctly returns the requested file, but the upload path treats the user-supplied destination as a tar extraction directory and preserves the source basename, producingdest.json/source.json. The non-Git path instead splits the destination into parent and target basename, producing the requesteddest.json. An existing E2E assertion currently codifies the inconsistent Git-path behavior.Recommendation
Reuse the existing single-file destination planning and archive renaming for Git-filtered regular files, without changing directory uploads or
.gitignorefiltering. Update the E2E case to assert destination renaming as well as single-file scoping.- addedarea:cliCLI-related workCLI-related worktest:e2eRequires end-to-end coverageRequires end-to-end coverageand removedstate:triage-neededOpened without agent diagnostics and needs triageOpened without agent diagnostics and needs triage
on Jul 13, 2026 Hi, just wanted to follow up. I still have the fix ready to submit upstream once my vouch request is approved. Let me know if there's anything I should change in the fix. Thank you!
This issue has had no activity for 14 days and is now marked stale. It may be closed in 7 days if there is no further activity. Comment or remove the state:stale label to keep it open.
- addedstate:staleInactive item at risk of automatic closure.Inactive item at risk of automatic closure.
on Aug 28, 2026
What happens
`openshell sandbox upload` creates a directory at the destination path instead of a regular file when the source file lives inside a git repository and the destination basename differs from the source basename. The directory contains the uploaded file under the original source basename.
What should happen
The file should land at the exact destination path with the destination basename, matching cp-style semantics — regardless of whether the source is inside a git repository.
How to reproduce
Case 1 — source in git repo (bug):
Case 2 — source outside git repo (correct):
Context
The cp-style fix from #694 corrected this for the non-git upload path. When the source is inside a git repository, the upload routes through
git_sync_files, which still uses the oldmkdir -p <dest>behavior. PR #1595 bypassedgit_sync_filesfor symlinks but not for regular tracked files.