Skip to content

Commit

Permalink
poke delete delete process actions before agent configurations (#9661)
Browse files Browse the repository at this point in the history
  • Loading branch information
spolu authored Dec 30, 2024
1 parent 3b2def6 commit 280f06f
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions front/poke/temporal/activities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import {
AgentDustAppRunAction,
AgentDustAppRunConfiguration,
} from "@app/lib/models/assistant/actions/dust_app_run";
import {
AgentProcessAction,
AgentProcessConfiguration,
} from "@app/lib/models/assistant/actions/process";
import { AgentRetrievalConfiguration } from "@app/lib/models/assistant/actions/retrieval";
import {
AgentTablesQueryAction,
Expand Down Expand Up @@ -323,6 +327,28 @@ export async function deleteAgentsActivity({
transaction: t,
});

const agentProcessConfigurations =
await AgentProcessConfiguration.findAll({
where: {
agentConfigurationId: agent.id,
},
transaction: t,
});
await AgentProcessAction.destroy({
where: {
processConfigurationId: {
[Op.in]: agentProcessConfigurations.map((r) => r.sId),
},
},
transaction: t,
});
await AgentProcessConfiguration.destroy({
where: {
agentConfigurationId: agent.id,
},
transaction: t,
});

await AgentUserRelation.destroy({
where: {
agentConfiguration: agent.sId,
Expand Down

0 comments on commit 280f06f

Please sign in to comment.