-
Notifications
You must be signed in to change notification settings - Fork 407
Description
Summary
openshell sandbox upload <sandbox> <local_path> <remote_dest> creates a directory at the destination path instead of overwriting the existing file when the remote destination already exists as a file.
Steps to Reproduce
- Ensure a file already exists inside the sandbox at the destination path, e.g.
/sandbox/.bashrc - Run the upload command targeting that same path:
openshell sandbox upload agent /tmp/updated-bashrc /sandbox/.bashrc - Inspect the remote path inside the sandbox:
openshell sandbox exec agent -- ls -la /sandbox/.bashrc
Expected Behavior
The existing file at /sandbox/.bashrc is overwritten with the contents of the local file /tmp/updated-bashrc.
Actual Behavior
A directory named .bashrc is created at /sandbox/.bashrc, and the uploaded file is placed inside it (e.g. /sandbox/.bashrc/updated-bashrc). The original file is silently replaced by a directory, breaking any process that expects a regular file at that path.
This is especially problematic for configuration file updates (.bashrc, openclaw.json, auth-profiles.json, etc.) where the silent replacement causes downstream failures that are difficult to diagnose.
Workaround
Use SSH to write files directly instead of openshell sandbox upload:
openshell sandbox exec agent -- bash -c 'cat > /sandbox/.bashrc' < /tmp/updated-bashrcAlternatively, after the upload creates the directory, move the file out and remove the directory:
openshell sandbox exec agent -- bash -c 'mv /sandbox/.bashrc/updated-bashrc /tmp/fix && rmdir /sandbox/.bashrc && mv /tmp/fix /sandbox/.bashrc'Environment
- openshell version: 0.0.15 and 0.0.16
- Platform: Linux x86_64 (Ubuntu)
- Sandbox type: agent