From efcc8a7d89729bfc82c8af00b87dfbdc656a30ab Mon Sep 17 00:00:00 2001 From: Dotta <34892728+cryppadotta@users.noreply.github.com> Date: Thu, 15 Oct 2026 06:57:38 -0500 Subject: [PATCH] test: bound command snapshot forwarding checks (#16421) Keep the command snapshot option test focused on forwarding and real file copyback. Use inline delegates in that test, and retain the separate real-worker suites and original deadlines. Validation: 124 affected tests, full typecheck/build, exact-head CI/E2E/Superagent and Apex 5/5. Negative controls reject lost command and restore forwarding. Failed earlier merge-readiness evidence remains in the PR. Co-Authored-By: Paperclip --- .../adapter-utils/src/sandbox-managed-runtime.test.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/adapter-utils/src/sandbox-managed-runtime.test.ts b/packages/adapter-utils/src/sandbox-managed-runtime.test.ts index d9331d310d2..b2135d1b279 100644 --- a/packages/adapter-utils/src/sandbox-managed-runtime.test.ts +++ b/packages/adapter-utils/src/sandbox-managed-runtime.test.ts @@ -427,7 +427,11 @@ describe("sandbox managed runtime", () => { const local = path.join(root, "local"), remote = path.join(root, "remote"); await mkdir(local); await writeFile(path.join(local, "file.txt"), "before"); - const capture = vi.spyOn(restoreMerge, "captureDirectorySnapshotOffThread"); + const mergeDirectoryWithBaseline = restoreMerge.mergeDirectoryWithBaseline; + const capture = vi.spyOn(restoreMerge, "captureDirectorySnapshotOffThread") + .mockImplementation(restoreMerge.captureDirectorySnapshot); + const merge = vi.spyOn(restoreMerge, "mergeDirectoryWithBaseline") + .mockImplementation(input => mergeDirectoryWithBaseline({ ...input, workspaceSnapshotIsolation: undefined })); try { const prepared = await prepareCommandManagedRuntime({ runner: makeInlineSpawnRunner(), @@ -442,8 +446,10 @@ describe("sandbox managed runtime", () => { expect(await readFile(path.join(remote, "file.txt"), "utf8")).toBe("before"); await writeFile(path.join(remote, "file.txt"), "after"); await prepared.restoreWorkspace(); + expect(merge).toHaveBeenCalled(); + expect(merge.mock.calls.every(([input]) => input.workspaceSnapshotIsolation === isolation)).toBe(true); expect(await readFile(path.join(local, "file.txt"), "utf8")).toBe("after"); - } finally { capture.mockRestore(); } + } finally { capture.mockRestore(); merge.mockRestore(); } }); it.each(["host_current", "adopt_remote", "durable_seed"] as const)("stages and restores both project repositories with independent Git histories (%s)", async (mode) => {