mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-04 19:28:46 +01:00
test(claude): assert qualified catalog and onboarding defaults
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
137e5bf399
commit
06c5f1b927
3 files changed
+19
-17
No files matched your search
@@ -1394,8 +1394,8 @@ describeEmbeddedPostgres("built-in agents", () => {
|
||||
icon: "sparkles",
|
||||
role: "general",
|
||||
reportsTo: root.id,
|
||||
adapterType: "claude_local",
|
||||
adapterConfig: { model: "claude-haiku-4-5" },
|
||||
adapterType: "paperclip_runner",
|
||||
adapterConfig: { provider: "acpx", acpxAgent: "claude", model: "claude-haiku-4-5" },
|
||||
budgetMonthlyCents: 0,
|
||||
});
|
||||
expect(state.status).toBe("paused");
|
||||
|
||||
@@ -94,13 +94,11 @@ describeEmbeddedPostgres("POST /api/companies/:companyId/onboarding-seed", () =>
|
||||
// The seed's free-text role is a job title; the structural role stays `ceo`.
|
||||
expect(companyAgents[0]?.title).toBe("Chief of Staff");
|
||||
expect(companyAgents[0]?.role).toBe("ceo");
|
||||
// A seeded CEO arrives with the core paperclip skills enabled. Skills only
|
||||
// reach an agent's runtime through its own desired set, and the default
|
||||
// CEO instructions assume this toolkit.
|
||||
// Native PRP supplies the operational contract. The seeded CEO retains
|
||||
// its role skills in its own desired set.
|
||||
expect(companyAgents[0]?.adapterConfig).toMatchObject({
|
||||
paperclipSkillSync: {
|
||||
desiredSkills: expect.arrayContaining([
|
||||
"paperclipai/paperclip/paperclip",
|
||||
"paperclipai/paperclip/paperclip-board",
|
||||
"paperclipai/paperclip/paperclip-converting-plans-to-tasks",
|
||||
"paperclipai/paperclip/paperclip-create-agent",
|
||||
@@ -131,7 +129,7 @@ describeEmbeddedPostgres("POST /api/companies/:companyId/onboarding-seed", () =>
|
||||
expect(record[0]?.issueId).toBe(companyIssues[0]?.id);
|
||||
});
|
||||
|
||||
it("keeps server-seeded onboarding on a legacy adapter when native runner is requested", async () => {
|
||||
it("uses the qualified Claude default for an unsupported seed adapter override", async () => {
|
||||
const previous = process.env.PAPERCLIP_ONBOARDING_SEED_ADAPTER_TYPE;
|
||||
process.env.PAPERCLIP_ONBOARDING_SEED_ADAPTER_TYPE = "paperclip_runner";
|
||||
try {
|
||||
@@ -142,7 +140,7 @@ describeEmbeddedPostgres("POST /api/companies/:companyId/onboarding-seed", () =>
|
||||
expect(response.status).toBe(200);
|
||||
const companyAgents = await ctx.db.select().from(agents).where(eq(agents.companyId, companyId));
|
||||
expect(companyAgents).toHaveLength(1);
|
||||
expect(companyAgents[0]?.adapterType).toBe("claude_local");
|
||||
expect(companyAgents[0]).toMatchObject({ adapterType: "paperclip_runner", adapterConfig: { provider: "acpx", acpxAgent: "claude", model: "claude-opus-5-5" } });
|
||||
} finally {
|
||||
if (previous === undefined) {
|
||||
delete process.env.PAPERCLIP_ONBOARDING_SEED_ADAPTER_TYPE;
|
||||
@@ -152,7 +150,7 @@ describeEmbeddedPostgres("POST /api/companies/:companyId/onboarding-seed", () =>
|
||||
}
|
||||
});
|
||||
|
||||
it("uses the creation default for server-seeded Codex without changing the Claude fallback", async () => {
|
||||
it("uses the creation default for server-seeded Codex", async () => {
|
||||
const previous = process.env.PAPERCLIP_ONBOARDING_SEED_ADAPTER_TYPE;
|
||||
process.env.PAPERCLIP_ONBOARDING_SEED_ADAPTER_TYPE = "codex_local";
|
||||
try {
|
||||
|
||||
@@ -66,14 +66,18 @@ describeEmbeddedPostgres("teams catalog install with no caller adapter overrides
|
||||
name: agents.name,
|
||||
role: agents.role,
|
||||
adapterType: agents.adapterType,
|
||||
adapterConfig: agents.adapterConfig,
|
||||
permissions: agents.permissions,
|
||||
})
|
||||
.from(agents)
|
||||
.where(eq(agents.companyId, companyId));
|
||||
for (const row of rows.filter(row => row.adapterType === "paperclip_runner")) {
|
||||
expect(row.adapterConfig).toMatchObject({ provider: "acpx", acpxAgent: "claude" });
|
||||
}
|
||||
return new Map(rows.map((row) => [row.name, row]));
|
||||
}
|
||||
|
||||
it("installs core-exec-team end-to-end with no caller overrides and creates 3 claude_local agents", async () => {
|
||||
it("installs core-exec-team end-to-end with no caller overrides and creates 3 native Claude agents", async () => {
|
||||
const companyId = await seedEmptyCompany();
|
||||
const svc = teamsCatalogService(db);
|
||||
|
||||
@@ -86,12 +90,12 @@ describeEmbeddedPostgres("teams catalog install with no caller adapter overrides
|
||||
expect(byName.size).toBe(3);
|
||||
|
||||
const adapterTypes = Array.from(byName.values()).map((row) => row.adapterType);
|
||||
expect(adapterTypes).toEqual(["claude_local", "claude_local", "claude_local"]);
|
||||
expect(adapterTypes).toEqual(["paperclip_runner", "paperclip_runner", "paperclip_runner"]);
|
||||
expect(adapterTypes).not.toContain("process");
|
||||
expect(adapterTypes).not.toContain("http");
|
||||
});
|
||||
|
||||
it("installs product-design end-to-end with no caller overrides and uses claude_local", async () => {
|
||||
it("installs product-design end-to-end with no caller overrides and uses native Claude", async () => {
|
||||
const companyId = await seedEmptyCompany();
|
||||
const svc = teamsCatalogService(db);
|
||||
|
||||
@@ -103,11 +107,11 @@ describeEmbeddedPostgres("teams catalog install with no caller adapter overrides
|
||||
const byName = await listAdapterTypesByName(companyId);
|
||||
expect(byName.size).toBe(1);
|
||||
const adapterTypes = Array.from(byName.values()).map((row) => row.adapterType);
|
||||
expect(adapterTypes).toEqual(["claude_local"]);
|
||||
expect(adapterTypes).toEqual(["paperclip_runner"]);
|
||||
expect(adapterTypes).not.toContain("process");
|
||||
});
|
||||
|
||||
it("installs product-engineering end-to-end with no caller overrides and uses claude_local for every agent", async () => {
|
||||
it("installs product-engineering end-to-end with no caller overrides and uses native Claude for every agent", async () => {
|
||||
const companyId = await seedEmptyCompany();
|
||||
const svc = teamsCatalogService(db);
|
||||
|
||||
@@ -119,12 +123,12 @@ describeEmbeddedPostgres("teams catalog install with no caller adapter overrides
|
||||
const byName = await listAdapterTypesByName(companyId);
|
||||
expect(byName.size).toBe(3);
|
||||
const adapterTypes = Array.from(byName.values()).map((row) => row.adapterType);
|
||||
expect(adapterTypes).toEqual(["claude_local", "claude_local", "claude_local"]);
|
||||
expect(adapterTypes).toEqual(["paperclip_runner", "paperclip_runner", "paperclip_runner"]);
|
||||
expect(adapterTypes).not.toContain("process");
|
||||
expect(byName.get("CTO")?.permissions).toMatchObject({ canCreateAgents: true });
|
||||
});
|
||||
|
||||
it("honors an explicit caller adapter override for a single slug while defaulting the rest to claude_local", async () => {
|
||||
it("honors an explicit caller adapter override for a single slug while defaulting the rest to native Claude", async () => {
|
||||
const companyId = await seedEmptyCompany();
|
||||
const svc = teamsCatalogService(db);
|
||||
|
||||
@@ -143,6 +147,6 @@ describeEmbeddedPostgres("teams catalog install with no caller adapter overrides
|
||||
const otherAdapters = Array.from(byName.values())
|
||||
.filter((row) => row !== ctoRow)
|
||||
.map((row) => row.adapterType);
|
||||
expect(otherAdapters).toEqual(["claude_local", "claude_local"]);
|
||||
expect(otherAdapters).toEqual(["paperclip_runner", "paperclip_runner"]);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user