mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-21 00:05:49 +02:00
test(boat): keep remote acceptance extensions in stacked PR
Preserve the two existing additive runtime acceptance suites in the stacked feature PR while keeping browser synchronization fixes in the independently checked core branch. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
da30252a5e
commit
8096727117
2 files changed
-64
No files matched your search
@@ -231,31 +231,6 @@ describe("claude remote execution", () => {
|
||||
}));
|
||||
});
|
||||
|
||||
it("keeps an authoritative remote workspace in place while delivering managed Claude assets", async () => {
|
||||
const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-claude-in-place-"));
|
||||
cleanupDirs.push(rootDir);
|
||||
await execute({
|
||||
runId: "run-in-place",
|
||||
agent: { id: "agent-1", companyId: "company-1", name: "Claude", adapterType: "claude_local", adapterConfig: {} },
|
||||
runtime: { sessionId: null, sessionParams: null, sessionDisplayId: null, taskKey: null },
|
||||
config: { engine: "cli", command: "claude", cwd: "/stale-host-cwd" },
|
||||
context: { paperclipWorkspace: { cwd: "/remote-only-agent-home", source: "agent_home" } },
|
||||
executionTarget: {
|
||||
kind: "remote", transport: "ssh", remoteCwd: "/old-copied-workspace",
|
||||
workspaceRealization: { mode: "in_place", authoritativeRoot: "/persistent-project", pathAliases: [], outboundRestorePaths: [] },
|
||||
spec: { host: "127.0.0.1", port: 2222, username: "fixture", remoteWorkspacePath: "/persistent-project", remoteCwd: "/persistent-project",
|
||||
privateKey: "PRIVATE KEY", knownHosts: "[127.0.0.1]:2222 ssh-ed25519 AAAA", strictHostKeyChecking: true },
|
||||
},
|
||||
onLog: async () => {},
|
||||
});
|
||||
expect(prepareWorkspaceForSshExecution).not.toHaveBeenCalled();
|
||||
expect(restoreWorkspaceFromSshExecution).not.toHaveBeenCalled();
|
||||
expect(syncDirectoryToSsh).toHaveBeenCalledTimes(2);
|
||||
expect(syncDirectoryToSsh).toHaveBeenCalledWith(expect.objectContaining({ remoteDir: "/persistent-project/.paperclip-runtime/claude/skills" }));
|
||||
const call = runChildProcess.mock.calls[0] as unknown as [string, string, string[], { remoteExecution: { remoteCwd: string } }];
|
||||
expect(call[3].remoteExecution.remoteCwd).toBe("/persistent-project");
|
||||
});
|
||||
|
||||
it("does not resume saved Claude sessions for remote SSH execution without a matching remote identity", async () => {
|
||||
const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-claude-remote-resume-"));
|
||||
cleanupDirs.push(rootDir);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { randomUUID } from "node:crypto";
|
||||
import type { CommandManagedRuntimeRunner } from "@paperclipai/adapter-utils/command-managed-runtime";
|
||||
import { mkdtemp, rm } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
@@ -219,44 +218,6 @@ describe.skipIf(!support.supported)("heartbeat runtime execution boundary", () =
|
||||
expectCleanup(input);
|
||||
});
|
||||
|
||||
it.each([true, false])("validates computer worktrees remotely before finalization (matching branch: %s)", async matches => {
|
||||
const { input, adapter } = await fixture();
|
||||
const remoteCwd = "/home/user/paperclip/company/projects/project/task";
|
||||
const runner: CommandManagedRuntimeRunner = {
|
||||
execute: vi.fn(async () => ({ exitCode: 0, signal: null, timedOut: false, pid: null, startedAt: new Date().toISOString(),
|
||||
stdout: matches ? "paperclip/task\n" : "other-task\n", stderr: "" })),
|
||||
};
|
||||
input.workspace.executionTarget = {
|
||||
kind: "remote", transport: "computer", remoteCwd, runner, processRunner: runner,
|
||||
listenerPort: 43100,
|
||||
resourceAuthority: { kind: "computer-owner", computerId: randomUUID(), ownerId: randomUUID(), generation: 1 },
|
||||
fileAuthority: { kind: "remote-persistent", placementId: randomUUID(), root: remoteCwd, agentHome: "/home/user/paperclip/company/agents/agent" },
|
||||
launch: vi.fn(), inspectProcess: vi.fn(async () => ({ running: false, claim: null })),
|
||||
retainWarm: vi.fn(), retire: vi.fn(async () => true), computerTool: { command: "computer", args: [] },
|
||||
};
|
||||
Object.assign(input.workspace.executionWorkspace, {
|
||||
cwd: remoteCwd, worktreePath: remoteCwd, strategy: "git_worktree", branchName: "paperclip/task",
|
||||
});
|
||||
adapter.execute.mockImplementationOnce(async ctx => {
|
||||
expect(ctx.stopRemoteStartup).toBeTypeOf("function");
|
||||
await expect(ctx.stopRemoteStartup!()).rejects.toThrow("Remote startup stop requires a cancelled run");
|
||||
expect(input.services.envOrchestrator.releaseForRun).not.toHaveBeenCalled();
|
||||
return { exitCode: 0, signal: null, timedOut: false };
|
||||
});
|
||||
if (matches) {
|
||||
await expect(executeHeartbeatRuntime(db, input)).resolves.toMatchObject({ dispatched: true });
|
||||
expect(await finalizations()).toMatchObject([{ status: "succeeded" }]);
|
||||
} else {
|
||||
await expect(executeHeartbeatRuntime(db, input)).rejects.toThrow("computer_workspace_branch_mismatch");
|
||||
expect(await finalizations()).toMatchObject([{ status: "failed" }]);
|
||||
}
|
||||
expect(runner.execute).toHaveBeenCalledOnce();
|
||||
expect(runner.execute).toHaveBeenCalledWith(expect.objectContaining({
|
||||
command: "git", args: ["symbolic-ref", "--quiet", "--short", "HEAD"], cwd: remoteCwd, bypassSession: true,
|
||||
}));
|
||||
expectCleanup(input);
|
||||
});
|
||||
|
||||
it("retains a failed sandbox restore even when persisting its receipt throws", async () => {
|
||||
const { input, adapter, run } = await fixture();
|
||||
input.workspace.executionTarget = { kind: "remote", transport: "sandbox", remoteCwd: home };
|
||||
|
||||
Reference in new issue
Block a user