fix(openshell): preserve uploaded workspace root

This commit is contained in:
Vincent Koc
2026-06-24 13:47:46 +08:00
committed by Vincent Koc
parent 12345e4c9b
commit d1a7d457e6
+5 -3
View File
@@ -738,9 +738,11 @@ class OpenShellSandboxBackendImpl {
async ({ dir: tmpDir }) => {
// Stage a symlink-free snapshot so upload never dereferences host paths
// outside the mirrored workspace tree.
const remoteRootName = path.posix.basename(remotePath);
const stagedRoot = path.join(tmpDir, remoteRootName);
await stageDirectoryContents({
sourceDir: localPath,
targetDir: tmpDir,
targetDir: stagedRoot,
});
const result = await runOpenShellCli({
context: this.params.execContext,
@@ -749,8 +751,8 @@ class OpenShellSandboxBackendImpl {
"upload",
"--no-git-ignore",
this.params.execContext.sandboxName,
tmpDir,
remotePath,
stagedRoot,
path.posix.dirname(remotePath),
],
cwd: this.params.createParams.workspaceDir,
});