Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions packages/agent-directory/src/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
filterInstances,
humanizeSlug,
isOrphanedInstance,
purposeAgentDefinitions,
purposeAgentInstances,
withDisplayName,
withDisplayNames,
Expand All @@ -33,31 +32,6 @@ const instance = {
address: "ins_1@acme.localhost",
};

const dailyDigestDefinition = {
...researcher,
id: "wfd_3",
name: "workbench-digest",
description: null,
};

const last30DaysResearchDefinition = {
...researcher,
id: "wfd_4",
name: "last-30-days-research",
description: null,
};

describe("purposeAgentDefinitions", () => {
test("drops routine-only workflow catalog utilities (Daily digest, Last 30 days research) — they are non-conversational, seeded as routines, and belong on the Routines page, not the Agents list", () => {
const result = purposeAgentDefinitions([
researcher,
dailyDigestDefinition,
last30DaysResearchDefinition,
]);
expect(result).toEqual([researcher]);
});
});

const invitedAgentInstance = {
...instance,
id: "ins_3",
Expand Down
41 changes: 2 additions & 39 deletions packages/agent-directory/test/routes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1234,26 +1234,6 @@ test("PUT /:definitionId 404s rather than 403s for a definition this tenant cann
expect(response.status).toBe(404);
});

test("GET/PUT /:definitionId refuse a workbench host's definition as 404, never exposing its prompt", async () => {
const hostName = `run-${"a".repeat(32)}`;
const getApp = buildApp(
fakeAssetService(),
fakeInstructionsDb({ id: "def_host", assetId: "ast_host", name: hostName }),
);
const getResponse = await getApp.request("/def_host");
expect(getResponse.status).toBe(404);

const putApp = buildApp(
fakeAssetService(),
fakeInstructionsDb({ id: "def_host", assetId: "ast_host", name: hostName }),
);
const putResponse = await put(putApp, "/def_host", {
name: "Not Actually Editable",
systemPrompt: "You are now a responder.",
});
expect(putResponse.status).toBe(404);
});

test("PUT /:definitionId updates the definition's row and its asset's row together, or neither", async () => {
const failingDb = fakeInstructionsDb(
{ id: "def_1", assetId: "ast_1", name: "research-buddy" },
Expand Down Expand Up @@ -1296,16 +1276,9 @@ test("a definition resolves by its immutable slug, not by scanning a listing pag
expect(body.name).toBe("research-buddy");
});

test("an unknown slug 404s, and a workbench host's name is never resolvable by slug", async () => {
test("an unknown slug 404s", async () => {
const unknown = buildApp(fakeAssetService(), fakeInstructionsDb(undefined));
expect((await unknown.request("/by-name/nobody")).status).toBe(404);

const hostName = `run-${"a".repeat(32)}`;
const host = buildApp(
fakeAssetService(),
fakeInstructionsDb({ id: "def_host", assetId: "ast_host", name: hostName }),
);
expect((await host.request(`/by-name/${hostName}`)).status).toBe(404);
});

// --- DELETE /:definitionId/capabilities/model (un-pin a model) ---
Expand Down Expand Up @@ -1416,19 +1389,9 @@ test("a status outside the schema's two lifecycle states is a 400, never written
expect(db.directUpdateCalls).toEqual([]);
});

test("status 404s for an unknown definition and for a workbench host", async () => {
test("status 404s for an unknown definition", async () => {
const unknown = buildApp(fakeAssetService(), fakeInstructionsDb(undefined));
expect((await put(unknown, "/def_missing/status", { status: "stopped" })).status).toBe(404);

const host = buildApp(
fakeAssetService(),
fakeInstructionsDb({
id: "def_host",
assetId: "ast_host",
name: `run-${"a".repeat(32)}`,
}),
);
expect((await put(host, "/def_host/status", { status: "stopped" })).status).toBe(404);
});

test("status scopes its grant check per definition id and requires update", async () => {
Expand Down
39 changes: 0 additions & 39 deletions packages/agent-directory/test/workflow-create-routes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,42 +451,3 @@ test("an invalid body is a 400", async () => {
});
expect(response.status).toBe(400);
});

test("GET /definitions lists conversational agents deployed in the caller's tenant", async () => {
const app = buildApp({
db: fakeDb({
definitions: [
{
id: "def_1",
tenantId: TENANT_ID,
name: "research-buddy",
description: "A careful researcher",
status: "deployed",
currentVersion: 1,
assetId: "ast_1",
},
{
id: "def_2",
tenantId: TENANT_ID,
name: "ins-0f1e2d3c4b5a69788796a5b4c3d2e1f0",
description: null,
status: "deployed",
currentVersion: 1,
assetId: "ast_2",
},
],
}),
});
const response = await app.request("/definitions", { headers: AUTH_HEADERS });
expect(response.status).toBe(200);
const body = (await response.json()) as {
definitions: { id: string; name: string; description: string | null }[];
};
expect(body.definitions).toEqual([
{
id: "def_1",
name: "research-buddy",
description: "A careful researcher",
},
]);
});
21 changes: 0 additions & 21 deletions packages/agent-directory/test/workflow-skill-pin-routes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { definitionFrom, SOURCE_TREE_PATHS, storedDefinitionBytesWithSkills } fr
const TENANT_ID = "tnt_1";
const OTHER_TENANT_ID = "tnt_2";
const TARGET_DEFINITION_ID = "def_1";
const WORKBENCH_HOST_DEFINITION_ID = "def_host";
const SIDECAR_TOKEN = "sidecar-token";
const RUN_ADDRESS = "run_1@example.com";

Expand Down Expand Up @@ -231,26 +230,6 @@ test("a definition in a different tenant is a 404, never leaked across tenants",
expect(response.status).toBe(404);
});

test("a workbench-host definition is a 404, never a pinnable target", async () => {
lookupId = WORKBENCH_HOST_DEFINITION_ID;
lookupTenant = TENANT_ID;
const app = buildApp({
db: fakeDbWithRows([
{
id: WORKBENCH_HOST_DEFINITION_ID,
tenantId: TENANT_ID,
assetId: "ast_host",
name: "ins-0f1e2d3c4b5a69788796a5b4c3d2e1f0",
},
]),
});
const response = await postPin(app, {
definitionId: WORKBENCH_HOST_DEFINITION_ID,
skillName: "research",
});
expect(response.status).toBe(404);
});

test("pins a skill onto another definition in the same tenant and re-indexes its prompt", async () => {
lookupId = TARGET_DEFINITION_ID;
lookupTenant = TENANT_ID;
Expand Down
7 changes: 5 additions & 2 deletions packages/webhook-triggers/test/launch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function baseDeps() {
cryptoProviderCache: {
get: async (key: string) => {
cryptoGetKeys.push(key);
return { sign: async (input: Uint8Array) => input } as never;
return { sign: async () => new Uint8Array(64) } as never;
},
},
repoStore: {
Expand Down Expand Up @@ -215,7 +215,10 @@ describe("launchWebhookTrigger", () => {
});
expect(prepareCalls).toHaveLength(1);
expect(resolveRefCalls).toHaveLength(1);
expect(routeMailCalls).toHaveLength(1);
// isRoutable defaults true in this fixture, so the unreachable send
// is retried once per `deliverWhenRoutable`'s contract before the
// failure is reported.
expect(routeMailCalls).toHaveLength(2);
});

// CL-7476: a freshly provisioned run's sidecar takes several seconds to
Expand Down
31 changes: 0 additions & 31 deletions packages/workflows/test/unreachable-message-contract.test.ts

This file was deleted.

Loading