From cf20a1f309623c784c165c3e9738778cfffa6a80 Mon Sep 17 00:00:00 2001 From: Dotta Date: Mon, 12 Oct 2026 17:18:53 -0500 Subject: [PATCH] test(claude): preserve explicit Legacy fixture boundaries Co-Authored-By: Paperclip --- server/src/__tests__/agent-hire-ai-connections.test.ts | 2 +- .../teams-catalog-install-no-overrides.test.ts | 10 +++++++++- .../agent-lifecycle/__tests__/lifecycle.test.ts | 2 +- tests/e2e/acp-stop-continuation.spec.ts | 2 +- tests/e2e/legacy-failure-continuation.spec.ts | 2 +- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/server/src/__tests__/agent-hire-ai-connections.test.ts b/server/src/__tests__/agent-hire-ai-connections.test.ts index 127ef9b996b..49ed5db35ef 100644 --- a/server/src/__tests__/agent-hire-ai-connections.test.ts +++ b/server/src/__tests__/agent-hire-ai-connections.test.ts @@ -133,7 +133,7 @@ describe("agent-created hires use managed AI connections", () => { const f = await fixture("openai"); const p = await poolFixture(f); await db.update(agents).set({ runtimeConfig: { aiConnection: p.binding } }).where(eq(agents.id, f.agentId)); - const response = await request(f.app).post(`/api/companies/${f.companyId}/agent-hires`).send({ name: "Incompatible teammate", role: "engineer", adapterType: "claude_local" }); + const response = await request(f.app).post(`/api/companies/${f.companyId}/agent-hires`).send({ name: "Incompatible teammate", role: "engineer", adapterType: "claude_local", runner: "legacy" }); expect(response.status, JSON.stringify(response.body)).toBe(422); // Fixed bindings contain identity only; compatibility is decided from // authoritative connection metadata when selecting each pool member. diff --git a/server/src/__tests__/teams-catalog-install-no-overrides.test.ts b/server/src/__tests__/teams-catalog-install-no-overrides.test.ts index 562a2f39040..5d49e08d246 100644 --- a/server/src/__tests__/teams-catalog-install-no-overrides.test.ts +++ b/server/src/__tests__/teams-catalog-install-no-overrides.test.ts @@ -2,7 +2,7 @@ import { randomUUID } from "node:crypto"; import { promises as fs } from "node:fs"; import os from "node:os"; import path from "node:path"; -import { afterAll, beforeAll, describe, expect, it } from "vitest"; +import { afterAll, beforeAll, describe, expect, it, vi } from "vitest"; import { eq } from "drizzle-orm"; import { agents, companies, createDb } from "@paperclipai/db"; import { @@ -11,6 +11,14 @@ import { } from "./helpers/embedded-postgres.js"; import { teamsCatalogService } from "../services/teams-catalog.js"; +// Bind the real creation resolver to the release target under test so the +// catalog contract is stable across the machines running this fixture. +vi.mock("../services/agent-runner-selection.js", async importOriginal => { + const actual = await importOriginal(); + return { ...actual, resolveNewAgentRunnerForCompany: async (_db: unknown, _companyId: string, input: Parameters[2]) => + actual.resolveNewAgentRunner({ ...input, target: { driver: "local", platform: "linux", architecture: "x64", libc: "glibc", glibcVersion: "2.39" } }) }; +}); + const embeddedPostgresSupport = await getEmbeddedPostgresTestSupport(); const describeEmbeddedPostgres = embeddedPostgresSupport.supported ? describe : describe.skip; diff --git a/server/src/modules/agent-lifecycle/__tests__/lifecycle.test.ts b/server/src/modules/agent-lifecycle/__tests__/lifecycle.test.ts index aaf1198d1c7..db97a41aaf5 100644 --- a/server/src/modules/agent-lifecycle/__tests__/lifecycle.test.ts +++ b/server/src/modules/agent-lifecycle/__tests__/lifecycle.test.ts @@ -106,7 +106,7 @@ const support = await getEmbeddedPostgresTestSupport(); const probe = vi.spyOn(adapter, "testEnvironment").mockResolvedValue({ adapterType, status: "warn", testedAt: new Date().toISOString(), checks: [{ code: `${adapterType.split("_")[0]}_hello_probe_auth_required`, level: "warn", message: "Login required" }] }); try { - const agent = await createAgentLifecycle(db).requestHire(companyId, { name: "Login test", adapterType }); + const agent = await createAgentLifecycle(db).requestHire(companyId, { name: "Login test", adapterType, runner: "legacy" }); const work = worker(createLifecycleDriver(db, {} as never).runHost); await work.process(agent.id); expect(probe).toHaveBeenCalled(); diff --git a/tests/e2e/acp-stop-continuation.spec.ts b/tests/e2e/acp-stop-continuation.spec.ts index 8e03550841f..3a5735e76b0 100644 --- a/tests/e2e/acp-stop-continuation.spec.ts +++ b/tests/e2e/acp-stop-continuation.spec.ts @@ -18,7 +18,7 @@ for (const { unfinishedWrite, stopResponse } of [{ unfinishedWrite: false, stopR try { await json(await request.patch("/api/instance/settings/experimental", { data: { enableClassicTaskInterface: false } })); const owner = await json(await request.post(`/api/companies/${company.id}/agents`, { data: { - name: "ACP Stop fixture", role: "engineer", adapterType: "claude_local", + name: "ACP Stop fixture", role: "engineer", adapterType: "claude_local", runner: "legacy", adapterConfig: { engine: "acp", cwd: root, stateDir: path.join(root, "state"), agentCommand: `${JSON.stringify(process.execPath)} ${JSON.stringify(path.resolve("scripts/mcp-fixtures/servers/acp-stop-agent.mjs"))}`, // The ACP fixture has no provider login. Use a fixture key to keep setup offline. diff --git a/tests/e2e/legacy-failure-continuation.spec.ts b/tests/e2e/legacy-failure-continuation.spec.ts index 6645935cbab..216261cb878 100644 --- a/tests/e2e/legacy-failure-continuation.spec.ts +++ b/tests/e2e/legacy-failure-continuation.spec.ts @@ -24,7 +24,7 @@ for (const action of ["task_retry", "thread_retry", "inbox_retry", "message", "q try { await writeFile(path.join(root, "continued"), "ready"); const agent = await json(await request.post(`/api/companies/${company.id}/agents`, { data: { - name: "Recovery fixture", role: "engineer", adapterType: "claude_local", + name: "Recovery fixture", role: "engineer", adapterType: "claude_local", runner: "legacy", adapterConfig: { engine: "acp", cwd: root, stateDir: path.join(root, "state"), agentCommand: `${JSON.stringify(process.execPath)} ${JSON.stringify(path.resolve("scripts/mcp-fixtures/servers/acp-stop-agent.mjs"))}`, // The ACP fixture has no provider login. Use a fixture key to keep setup offline.