diff --git a/server/src/routes/threads/chat.ts b/server/src/routes/threads/chat.ts index 1a7a78e2..6e1cc6d4 100644 --- a/server/src/routes/threads/chat.ts +++ b/server/src/routes/threads/chat.ts @@ -72,6 +72,7 @@ chatRoutes.openapi(chatRoute, async (c) => { const isAdmin = principal.type === "admin"; const adminUser = isAdmin ? requireAdminUser(principal) : undefined; + const useAdminAgents = isAdmin && adminUser?.role !== "staff"; const storage = await getStorage(c.env.DB); @@ -88,7 +89,7 @@ chatRoutes.openapi(chatRoute, async (c) => { logger.info(`[Chat] intent: ${intent}`, { threadId }); const neppChanAgent = createNeppChanAgent({ - isAdmin, + isAdmin: useAdminAgents, modelConfig, }); const mastra = new Mastra({