Use isolated computer storage paths during restart reattachment

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-10 10:23:59 -05:00
1 parent 5a16ef77c0
commit af93abd90a
2 files changed
+5 -5

No files matched your search

@@ -488,12 +488,16 @@ describe("remote controller restart adoption", () => {
const { sandboxLeaseAcquisition, ...common } = sandbox;
const inspectProcess = vi.fn(async () => ({ running: true, claim: { nonce: "process-claim" } }));
const target = { ...common, transport: "computer", listenerPort: 45101,
fileAuthority: { kind: "remote-persistent", root: "/workspace", placementId: "workspace", agentHome: "/home/user/agent" },
resourceAuthority: { kind: "computer-owner", computerId: "computer", ownerId: "owner", generation: 7 }, inspectProcess };
const computerClaim = { ...claim, remote: { ...claim.remote, providerLeaseId: "owner",
computerOwner: { computerId: "computer", ownerId: "owner", generation: 7, listenerPort: 45101 } } };
const adopted = await verifyRemoteRunnerReattachment({ claim: computerClaim, target: target as never,
identity, runId: "run", normalizedSessionId: "session" });
expect(adopted.pid).toBe(123);
const storage = remoteRunnerStorageRoots(target as never, "session");
expect(execute.mock.calls[0]![0].args.join(" ")).toContain(`${storage.sessionRoot}/runner/runner-state.json`);
expect(execute.mock.calls.some(([request]) => request.args.includes(`${storage.sessionRoot}/runner/runner-process.identity`))).toBe(true);
expect(inspectProcess).toHaveBeenCalledOnce();
const readCount = execute.mock.calls.length;
await expect(verifyRemoteRunnerReattachment({ claim: { ...computerClaim, remote: {
@@ -10877,11 +10877,7 @@ export async function verifyRemoteRunnerReattachment(input: {
}
const runner = target.runner;
const stateDirectory = posix.join(
target.remoteCwd,
".paperclip-runtime",
"paperclip-runner",
"sessions",
createHash("sha256").update(input.normalizedSessionId).digest("hex"),
remoteRunnerStorageRoots(target, input.normalizedSessionId).sessionRoot,
"runner",
);
const runnerState = await readRemoteRunnerState({ runner, stateDirectory });