diff --git a/front/lib/api/assistant/configuration.ts b/front/lib/api/assistant/configuration.ts index bf42a9892557..63b34ee0c818 100644 --- a/front/lib/api/assistant/configuration.ts +++ b/front/lib/api/assistant/configuration.ts @@ -307,17 +307,27 @@ async function fetchWorkspaceAgentConfigurationsWithoutActions( case "list": const user = auth.user(); - return AgentConfiguration.findAll({ + const sharedAssistants = await AgentConfiguration.findAll({ + ...baseAgentsSequelizeQuery, + where: { + ...baseWhereConditions, + scope: { [Op.in]: ["workspace", "published"] }, + }, + }); + if (!user) { + return sharedAssistants; + } + + const userAssistants = await AgentConfiguration.findAll({ ...baseAgentsSequelizeQuery, where: { ...baseWhereConditions, - [Op.or]: [ - { scope: { [Op.in]: ["workspace", "published"] } }, - { authorId: user?.id }, - ], + authorId: user.id, + scope: "private", }, }); + return [...sharedAssistants, ...userAssistants]; default: if (typeof agentsGetView === "object" && "agentIds" in agentsGetView) { return AgentConfiguration.findAll({