mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-01 09:39:53 +01:00
merge: integrate agent lifecycle ownership from master
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
commit
ad5d8826ad
159 files changed
+7173
-2805
No files matched your search
@@ -21,9 +21,12 @@ for (const { unfinishedWrite, stopResponse } of [{ unfinishedWrite: false, stopR
|
||||
name: "ACP Stop fixture", role: "engineer", adapterType: "claude_local",
|
||||
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"))}`,
|
||||
env: { PAPERCLIP_STOP_FIXTURE_ROOT: root, PAPERCLIP_STOP_FIXTURE_FINISH_TASK: "1", ...(unfinishedWrite ? { PAPERCLIP_STOP_FIXTURE_TOOL: "write" } : {}) },
|
||||
// The ACP fixture has no provider login. Use a fixture key to keep setup offline.
|
||||
env: { ANTHROPIC_API_KEY: "acp-stop-fixture-key", PAPERCLIP_STOP_FIXTURE_ROOT: root, PAPERCLIP_STOP_FIXTURE_FINISH_TASK: "1", ...(unfinishedWrite ? { PAPERCLIP_STOP_FIXTURE_TOOL: "write" } : {}) },
|
||||
}, runtimeConfig: { heartbeat: { enabled: false, wakeOnDemand: true } },
|
||||
} }));
|
||||
await expect.poll(async () => (await json(await request.get(`/api/agents/${owner.id}`))).lifecycleState,
|
||||
{ timeout: 45_000 }).toBe("ready");
|
||||
const issue = await json(await request.post(`/api/companies/${company.id}/issues`, { data: {
|
||||
title: "ACP Stop continuation", status: "backlog", assigneeAgentId: owner.id,
|
||||
} }));
|
||||
|
||||
@@ -4,7 +4,7 @@ import path from "node:path";
|
||||
import { expect, test } from "@playwright/test";
|
||||
import { json } from "./agent-chat.shared";
|
||||
|
||||
test("missing onboarding key offers personal Claude setup in chat and resumes once", async ({ page, request }) => {
|
||||
test("a ready agent with a missing personal key offers Claude setup in chat and resumes once", async ({ page, request }) => {
|
||||
test.setTimeout(120_000);
|
||||
const root = await mkdtemp(path.join(os.tmpdir(), "personal-ai-recovery-"));
|
||||
const original = await json(await request.get("/api/instance/settings/experimental"));
|
||||
@@ -16,12 +16,17 @@ test("missing onboarding key offers personal Claude setup in chat and resumes on
|
||||
}));
|
||||
await writeFile(path.join(root, "continued"), "ready");
|
||||
const agent = await json(await request.post(`/api/companies/${company.id}/agents`, { data: {
|
||||
name: "Chief of Staff", role: "general", adapterType: "claude_local",
|
||||
name: "Chief of Staff", role: "general", adapterType: "process",
|
||||
adapterConfig: { command: process.execPath },
|
||||
runtimeConfig: { heartbeat: { enabled: false, wakeOnDemand: true } },
|
||||
} }));
|
||||
await expect.poll(async () => (await json(await request.get(`/api/agents/${agent.id}`))).lifecycleState).toBe("ready");
|
||||
await json(await request.patch(`/api/agents/${agent.id}`, { data: {
|
||||
adapterType: "claude_local",
|
||||
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"))}`,
|
||||
env: { ANTHROPIC_API_KEY: { type: "user_secret_ref", key: definition.key, version: "latest", required: true },
|
||||
PAPERCLIP_STOP_FIXTURE_ROOT: root } },
|
||||
runtimeConfig: { heartbeat: { enabled: false, wakeOnDemand: true } },
|
||||
} }));
|
||||
const chatPath = `/api/companies/${company.id}/chats/${agent.id}`;
|
||||
await page.goto(`/${company.issuePrefix}/chats/${agent.id}`);
|
||||
|
||||
@@ -27,9 +27,12 @@ for (const action of ["task_retry", "thread_retry", "inbox_retry", "message", "q
|
||||
name: "Recovery fixture", role: "engineer", adapterType: "claude_local",
|
||||
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"))}`,
|
||||
env: { PAPERCLIP_STOP_FIXTURE_ROOT: root, PAPERCLIP_STOP_FIXTURE_FINISH_TASK: "1" } },
|
||||
// The ACP fixture has no provider login. Use a fixture key to keep setup offline.
|
||||
env: { ANTHROPIC_API_KEY: "acp-stop-fixture-key", PAPERCLIP_STOP_FIXTURE_ROOT: root, PAPERCLIP_STOP_FIXTURE_FINISH_TASK: "1" } },
|
||||
runtimeConfig: { heartbeat: { enabled: false, wakeOnDemand: true } },
|
||||
} }));
|
||||
await expect.poll(async () => (await json(await request.get(`/api/agents/${agent.id}`))).lifecycleState,
|
||||
{ timeout: 45_000 }).toBe("ready");
|
||||
const issue = await json(await request.post(`/api/companies/${company.id}/issues`, { data: {
|
||||
title: "Continue after startup failure", description: "Answer the pending follow-up once.",
|
||||
status: "backlog", assigneeAgentId: agent.id,
|
||||
|
||||
Reference in new issue
Block a user