mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-25 17:45:53 +01:00
test(server): assert aggregate runtime MCP assignment
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
91a66e65bb
commit
761b60b42c
1 file changed
+11
-3
@@ -411,12 +411,20 @@ describeEmbeddedPostgres("heartbeat runtime skill version pins", () => {
|
||||
const captured = capturedRuns.find((entry) => entry.agentId === agentId);
|
||||
expect(captured?.mcpServers).toHaveLength(1);
|
||||
expect(captured?.mcpServers[0]).toMatchObject({
|
||||
connectionId: installed!.id,
|
||||
name: installed!.name,
|
||||
connectionId: expect.stringMatching(/^assignment:[a-f0-9]{64}$/),
|
||||
name: "paperclip-assigned",
|
||||
token: expect.stringMatching(/^pcgw_/),
|
||||
url: expect.stringContaining("/api/tool-gateway/gateways/"),
|
||||
});
|
||||
expect(captured?.mcpServers.some((server) => server.connectionId === uninstalled!.id)).toBe(false);
|
||||
const runtimeProfiles = await db.select().from(toolProfiles);
|
||||
const runtimeProfile = runtimeProfiles.find((entry) =>
|
||||
entry.profileKey.startsWith(`native:${agentId}:`)
|
||||
);
|
||||
expect(runtimeProfile).toBeDefined();
|
||||
const runtimeEntries = await db.select().from(toolProfileEntries)
|
||||
.where(eq(toolProfileEntries.profileId, runtimeProfile!.id));
|
||||
expect(runtimeEntries.map((entry) => entry.connectionId)).toEqual([installed!.id]);
|
||||
expect(JSON.stringify(captured?.mcpServers)).not.toContain(uninstalled!.id);
|
||||
const bearer = captured?.mcpServers[0]?.token;
|
||||
expect(bearer).toMatch(/^pcgw_/);
|
||||
if (!bearer) throw new Error("Expected runtime MCP bearer");
|
||||
|
||||
Reference in new issue
Block a user