diff --git a/front/poke/temporal/activities.ts b/front/poke/temporal/activities.ts index 1a896c1986a2..d83f71d7c1ed 100644 --- a/front/poke/temporal/activities.ts +++ b/front/poke/temporal/activities.ts @@ -25,6 +25,10 @@ import { AgentTablesQueryConfiguration, AgentTablesQueryConfigurationTable, } from "@app/lib/models/assistant/actions/tables_query"; +import { + AgentWebsearchAction, + AgentWebsearchConfiguration, +} from "@app/lib/models/assistant/actions/websearch"; import { AgentConfiguration, AgentUserRelation, @@ -297,6 +301,28 @@ export async function deleteAgentsActivity({ transaction: t, }); + const agentWebsearchConfigurations = + await AgentWebsearchConfiguration.findAll({ + where: { + agentConfigurationId: agent.id, + }, + transaction: t, + }); + await AgentWebsearchAction.destroy({ + where: { + websearchConfigurationId: { + [Op.in]: agentWebsearchConfigurations.map((r) => r.sId), + }, + }, + transaction: t, + }); + await AgentWebsearchConfiguration.destroy({ + where: { + agentConfigurationId: agent.id, + }, + transaction: t, + }); + await AgentUserRelation.destroy({ where: { agentConfiguration: agent.sId,