Skip to content

bug: sandbox upload no longer preserves symlinks (regression from #1595) #2309

Closed

Description

@loveRhythm1990

Agent Diagnostic

Description

Standalone openshell sandbox upload no longer preserves a symlink when the source path itself is a symlink.

Actual behavior: A symlink to a directory is uploaded as a real directory containing the target’s contents. A dangling
symlink is rejected as a missing local path.

Expected behavior: The sandbox should receive a symlink with the same target path. Dangling symlinks should also be
preserved, matching the documented behavior and the fix from #1595.

sandbox create --upload is not affected because it already uses the symlink-aware upload planner.

Reproduction Steps

  1. Build the current CLI and create a sandbox:
OS="$(pwd)/target/release/openshell"
NAME="symlink-repro-$(date +%s)"
"$OS" sandbox create --name "$NAME" -- true
  1. Create a Git repository containing a directory symlink and a dangling symlink:
tmp="$(mktemp -d)"
git -C "$tmp" init -q
mkdir "$tmp/real-dir"
echo hello > "$tmp/real-dir/file.txt"
ln -s real-dir "$tmp/link-dir"
git -C "$tmp" add real-dir link-dir
ln -s missing "$tmp/dangling"
  1. Upload the directory symlink:
"$OS" sandbox upload "$NAME" "$tmp/link-dir" /sandbox/link-dir
  1. Inspect the uploaded path:
"$OS" sandbox exec -n "$NAME" --no-tty -- test -L /sandbox/link-dir
echo "test -L exit=$?"

"$OS" sandbox exec -n "$NAME" --no-tty -- sh -c \
  'if [ -L /sandbox/link-dir ]; then echo SYMLINK; readlink /sandbox/link-dir; elif [ -d /sandbox/link-dir ]; then echo
  REAL_DIR; else echo OTHER; fi'
  1. Try the dangling symlink:
"$OS" sandbox upload "$NAME" "$tmp/dangling" /sandbox/dangling

Environment

  • OS: macOS 26.5.2, arm64
  • Docker: 29.3.1
  • OpenShell: 0.0.85-dev.5+g3dee5570
  • Latest release checked: v0.0.83
  • Possible duplicates checked: yes; no open duplicate found

Logs

Uploading .../link-dir -> sandbox:/sandbox/link-dir
  ✓ Upload complete
  test -L exit=1
  REAL_DIR
  

  For a dangling symlink:

  
  Error: local path does not exist: .../dangling

Agent-First Checklist

  • I pointed my agent at the repo and had it investigate this issue
  • I loaded relevant skills (e.g., debug-openshell-cluster, debug-inference, openshell-cli)
  • I checked the latest OpenShell release and either reproduced the issue there or explained why I cannot upgrade/test it
  • I searched existing issues for possible duplicates or explained why I could not
  • My agent could not resolve this — the diagnostic above explains why

Activity

  1. loveRhythm1990 commented on Jul 16, 2026

    @loveRhythm1990
    ContributorAuthor

    I’d like to work on this. I have a local reproduction and will submit a focused fix with regression tests.

  2. removed
    state:triage-neededOpened without agent diagnostics and needs triage
    on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions