mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-04 11:01:16 +01:00
Calibrate planning task creation against the current composer
Retain the zero-model UI setup failure and create tasks through the real composer response. Remove random chat-fixture prefix collisions. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
370e51d110
commit
8538cfce4c
7 files changed
+115
-7
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import { randomUUID } from "node:crypto";
|
||||
import { expect, test } from "@playwright/test";
|
||||
import { createPlanTaskThroughUi } from "../runner-e2e/plan-task-ui.js";
|
||||
|
||||
test("planning fixture creates the exact assignment through the current composer without providers", async ({ page, request }) => {
|
||||
const companyResponse = await request.post("/api/companies", { data: { name: `Planning setup ${randomUUID()}` } });
|
||||
expect(companyResponse.ok()).toBe(true);
|
||||
const company = await companyResponse.json();
|
||||
try {
|
||||
let lead: { id: string; name: string } | undefined;
|
||||
for (const name of ["A Different Owner", "Planning Fixture Lead"]) {
|
||||
const response = await request.post(`/api/companies/${company.id}/agents`, { data: {
|
||||
name, role: "general", adapterType: "process", adapterConfig: { command: "false" },
|
||||
runtimeConfig: { heartbeat: { enabled: false } },
|
||||
} });
|
||||
expect(response.ok()).toBe(true);
|
||||
const agent = await response.json();
|
||||
expect((await request.post(`/api/agents/${agent.id}/pause`)).ok()).toBe(true);
|
||||
lead = agent;
|
||||
}
|
||||
const prompt = "Plan the work briefly, then carry it out. Verify a sample order and save the requested result.";
|
||||
const created = await createPlanTaskThroughUi({ page, companyId: company.id, issuePrefix: company.issuePrefix,
|
||||
agentName: lead!.name, prompt });
|
||||
const issue = await (await request.get(`/api/issues/${created.id}`)).json();
|
||||
expect(issue).toMatchObject({ companyId: company.id, assigneeAgentId: lead!.id, description: prompt, workMode: "standard" });
|
||||
const runs = await request.get(`/api/companies/${company.id}/heartbeat-runs?limit=100`);
|
||||
expect(runs.ok()).toBe(true);
|
||||
expect(await runs.json()).toEqual([]);
|
||||
} finally {
|
||||
expect((await request.delete(`/api/companies/${company.id}`)).ok()).toBe(true);
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user