MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / createBotRequest

Function createBotRequest

apps/web/src/lib/bot/request-logging.test.ts:33–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31 const createdUserIds = new Set<string>();
32
33 async function createBotRequest() {
34 const user = await insertTestUser();
35 createdUserIds.add(user.id);
36
37 const [row] = await db
38 .insert(bot_requests)
39 .values({
40 created_by: user.id,
41 platform: 'slack',
42 platform_thread_id: `slack:T123:C456:${randomUUID()}`,
43 platform_message_id: `message-${randomUUID()}`,
44 user_message: 'Please make a change',
45 status: 'pending',
46 })
47 .returning({ id: bot_requests.id });
48
49 if (!row) {
50 throw new Error('Failed to create bot request fixture');
51 }
52
53 createdBotRequestIds.add(row.id);
54 return row.id;
55 }
56
57 afterEach(async () => {
58 const cloudAgentSessionIds = Array.from(createdCloudAgentSessionIds);

Callers 1

Calls 3

insertTestUserFunction · 0.90
addMethod · 0.80
valuesMethod · 0.65

Tested by

no test coverage detected