mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-03 20:09:33 +01:00
Verify agent harnesses through bounded computer probe owners
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
ebb60670c1
commit
d29e2a8bfe
8 files changed
+70
-12
No files matched your search
@@ -313,6 +313,25 @@ describe("server adapter registry", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("verifies the Claude harness on a computer after checking its platform", async () => {
|
||||
const calls: string[] = [];
|
||||
const result = await requireServerAdapter("paperclip_runner").testEnvironment({
|
||||
companyId: "company-1", adapterType: "paperclip_runner",
|
||||
config: { provider: "acpx", acpxAgent: "claude", model: "claude-sonnet-4-6", env: { ANTHROPIC_API_KEY: "test-key" } },
|
||||
executionTarget: { kind: "remote", transport: "computer", remoteCwd: "/workspace", resourceAuthority: { computerId: "computer" },
|
||||
runner: { execute: async (input: { command: string; args?: string[] }) => {
|
||||
calls.push(input.command);
|
||||
const stdout = input.command === "claude" ? JSON.stringify({ type: "result", result: "hello", usage: { input_tokens: 1, output_tokens: 1 } })
|
||||
: input.args?.some(arg => arg.includes("uname -s")) ? "Linux\nx86_64\n" : "";
|
||||
return { exitCode: 0, timedOut: false, stdout, stderr: "", signal: null, pid: null, startedAt: new Date().toISOString() };
|
||||
} },
|
||||
} as never,
|
||||
});
|
||||
expect(calls).toContain("claude");
|
||||
expect(result.checks).toContainEqual(expect.objectContaining({ code: "claude_hello_probe_passed", level: "info" }));
|
||||
expect(result.checks.some(check => check.level === "error")).toBe(false);
|
||||
});
|
||||
|
||||
it.each([true, false])("checks actual local ACPX installation readiness (%s)", async (ready) => {
|
||||
const probe = vi.mocked(probeAcpxClaudeInstallation);
|
||||
if (ready) probe.mockResolvedValueOnce(undefined);
|
||||
|
||||
@@ -298,7 +298,7 @@ describe("claude_local environment diagnostics", () => {
|
||||
expect(result.checks.some((check) => check.code === "claude_cwd_invalid")).toBe(false);
|
||||
});
|
||||
|
||||
it("uses full permission bypass for sandbox hello probes", async () => {
|
||||
it.each(["sandbox", "computer"] as const)("uses full permission bypass for %s hello probes", async (transport) => {
|
||||
const executeCalls: Array<{ command: string; args?: string[]; env?: Record<string, string> }> = [];
|
||||
|
||||
const result = await testEnvironment({
|
||||
@@ -310,11 +310,12 @@ describe("claude_local environment diagnostics", () => {
|
||||
},
|
||||
executionTarget: {
|
||||
kind: "remote",
|
||||
transport: "sandbox",
|
||||
transport,
|
||||
resourceAuthority: { computerId: "probe-computer" },
|
||||
providerKey: "cloudflare",
|
||||
remoteCwd: "/workspace/paperclip",
|
||||
runner: {
|
||||
execute: async (input) => {
|
||||
execute: async (input: { command: string; args?: string[]; env?: Record<string, string> }) => {
|
||||
executeCalls.push({ command: input.command, args: input.args, env: input.env });
|
||||
if (input.command === "claude") {
|
||||
return {
|
||||
@@ -345,7 +346,7 @@ describe("claude_local environment diagnostics", () => {
|
||||
};
|
||||
},
|
||||
},
|
||||
},
|
||||
} as never,
|
||||
environmentName: "QA Cloudflare",
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user