




















@@ -29,6 +29,7 @@ const cliMocks = vi.hoisted(() => ({
29293030let createOpenShellSandboxBackendManager: typeof import("./backend.js").createOpenShellSandboxBackendManager;
3131let createOpenShellSandboxBackendFactory: typeof import("./backend.js").createOpenShellSandboxBackendFactory;
32+let buildOpenShellDirectoryUploadArgs: typeof import("./backend.js").buildOpenShellDirectoryUploadArgs;
3233let ensureOpenShellRemoteRealDirectoryScript: typeof import("./backend.js").ENSURE_OPEN_SHELL_REMOTE_REAL_DIRECTORY_SCRIPT;
33343435describe("openshell cli helpers", () => {
@@ -172,6 +173,7 @@ describe("openshell backend manager", () => {
172173};
173174});
174175({
176+ buildOpenShellDirectoryUploadArgs,
175177ENSURE_OPEN_SHELL_REMOTE_REAL_DIRECTORY_SCRIPT: ensureOpenShellRemoteRealDirectoryScript,
176178 createOpenShellSandboxBackendFactory,
177179 createOpenShellSandboxBackendManager,
@@ -187,6 +189,30 @@ describe("openshell backend manager", () => {
187189vi.clearAllMocks();
188190});
189191192+it("uploads staged directory snapshots to the managed remote directory itself", () => {
193+expect(
194+buildOpenShellDirectoryUploadArgs({
195+sandboxName: "openclaw-session",
196+localPath: "/tmp/openclaw-upload/sandbox/seed.txt",
197+remotePath: "/sandbox",
198+}),
199+).toEqual([
200+"sandbox",
201+"upload",
202+"--no-git-ignore",
203+"openclaw-session",
204+"/tmp/openclaw-upload/sandbox/seed.txt",
205+"/sandbox",
206+]);
207+expect(
208+buildOpenShellDirectoryUploadArgs({
209+sandboxName: "openclaw-session",
210+localPath: "/tmp/openclaw-upload/project",
211+remotePath: "/sandbox/./project",
212+}).at(-1),
213+).toBe("/sandbox/project");
214+});
215+190216it.runIf(process.platform !== "win32")(
191217"preserves caller positional args after OpenShell remote directory validation",
192218async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。