Bohan Jiang
45ff984518
fix(labels): sweep resource-label junctions on bulk deletes (MUL-4479) ( #5348 )
...
* fix(labels): sweep resource-label junctions on bulk deletes (MUL-4479)
Runtime, runtime-profile, and workspace deletion hard-delete their agents
and skills without clearing agent_to_label / skill_to_label. Migration 173
dropped the junction foreign keys, so these rows are no longer cascade-cleaned;
once resource labels are enabled, every labelled agent/skill removed through one
of these bulk paths leaves a permanent, invisible orphan junction row.
Clear the junctions in the same transaction as the owner delete, before the
owning rows disappear:
- DeleteAgentRuntime / ArchiveAgentsAndDeleteRuntime / DeleteRuntimeProfile:
DeleteAgentLabelAssignmentsByRuntime, ahead of the archived-agent hard-delete.
- DeleteWorkspace: DeleteAgentLabelAssignmentsByWorkspace +
DeleteSkillLabelAssignmentsByWorkspace, ahead of the workspace cascade.
Adds regression tests for all four delete paths.
Follow-up to #5345 (Elon review). Resource labels must stay disabled until this
lands.
Co-authored-by: multica-agent <github@multica.ai >
* fix(labels): make workspace cleanup atomic
Co-authored-by: multica-agent <github@multica.ai >
---------
Co-authored-by: J <j@multica.ai >
Co-authored-by: multica-agent <github@multica.ai >
Co-authored-by: Eve <eve@multica-ai.local >
2026-07-13 20:07:24 +08:00
..
2026-06-17 15:18:44 +02:00
2026-05-28 16:05:19 +08:00
2026-05-28 16:05:19 +08:00
2026-07-03 14:18:43 +08:00
2026-07-03 14:18:43 +08:00
2026-07-13 18:13:44 +08:00
2026-07-13 18:13:44 +08:00
2026-07-03 14:18:43 +08:00
2026-05-28 19:06:57 +08:00
2026-07-03 14:18:43 +08:00
2026-07-03 17:56:02 +08:00
2026-06-13 15:33:28 +08:00
2026-07-03 17:56:02 +08:00
2026-07-03 17:56:02 +08:00
2026-05-28 19:06:57 +08:00
2026-07-10 13:00:34 +08:00
2026-05-28 15:53:16 +08:00
2026-07-12 15:40:10 +08:00
2026-06-03 16:39:06 +08:00
2026-07-07 20:49:42 +08:00
2026-06-30 12:29:11 +08:00
2026-07-03 14:18:43 +08:00
2026-07-07 20:49:42 +08:00
2026-06-03 16:39:06 +08:00
2026-07-07 20:49:42 +08:00
2026-06-18 09:40:38 +08:00
2026-07-13 09:15:36 +08:00
2026-07-01 12:46:47 +08:00
2026-07-01 12:46:47 +08:00
2026-07-10 16:22:42 +08:00
2026-07-07 13:20:30 +08:00
2026-07-08 21:58:16 +08:00
2026-07-13 16:22:44 +08:00
2026-07-09 13:49:07 +08:00
2026-07-09 13:49:07 +08:00
2026-07-13 18:13:44 +08:00
2026-05-28 16:05:19 +08:00
2026-05-28 16:05:19 +08:00
2026-06-24 09:52:18 +08:00
2026-06-01 08:28:15 +08:00
2026-07-10 14:10:10 +08:00
2026-07-12 14:23:30 +08:00
2026-07-10 16:15:10 +08:00
2026-06-10 14:20:39 +08:00
2026-06-30 12:24:57 +08:00
2026-07-12 14:23:30 +08:00
2026-07-13 16:42:46 +08:00
2026-07-13 16:42:46 +08:00
2026-06-03 16:39:06 +08:00
2026-06-04 13:12:32 +08:00
2026-07-10 14:10:10 +08:00
2026-07-10 13:43:45 +08:00
2026-07-08 21:58:16 +08:00
2026-06-17 16:00:22 +08:00
2026-07-10 16:22:42 +08:00
2026-07-02 18:31:45 +08:00
2026-06-18 11:10:06 +08:00
2026-07-13 18:13:44 +08:00
2026-06-03 16:39:06 +08:00
2026-07-07 12:38:07 +08:00
2026-07-13 09:15:36 +08:00
2026-07-10 20:10:25 +08:00
2026-07-10 20:10:25 +08:00
2026-07-03 14:18:43 +08:00
2026-07-07 14:43:19 +08:00
2026-07-13 16:42:46 +08:00
2026-06-26 12:09:15 +08:00
2026-07-13 16:42:46 +08:00
2026-07-03 16:10:19 +08:00
2026-06-03 16:39:06 +08:00
2026-07-09 15:10:09 +08:00
2026-07-09 15:10:09 +08:00
2026-07-02 14:11:10 +08:00
2026-07-10 09:11:29 +08:00
2026-07-13 16:15:58 +08:00
2026-07-05 01:35:00 +08:00
2026-07-02 15:48:45 +08:00
2026-07-10 09:11:29 +08:00
2026-06-24 16:06:14 +08:00
2026-05-28 14:20:20 +08:00
2026-07-13 13:08:04 +08:00
2026-06-02 17:17:41 +08:00
2026-07-06 19:11:47 +08:00
2026-07-13 13:08:04 +08:00
2026-06-23 13:17:13 +08:00
2026-07-03 14:18:43 +08:00
2026-06-16 12:26:44 +08:00
2026-07-13 16:15:58 +08:00
2026-07-13 18:13:44 +08:00
2026-07-13 18:13:44 +08:00
2026-07-08 16:19:41 +08:00
2026-07-08 16:19:41 +08:00
2026-07-03 14:18:43 +08:00
2026-07-03 14:18:43 +08:00
2026-06-30 12:24:57 +08:00
2026-06-03 16:39:06 +08:00
2026-07-01 17:53:16 +08:00
2026-07-01 17:53:16 +08:00
2026-05-27 22:22:26 +08:00
2026-05-27 22:22:26 +08:00
2026-07-13 13:22:02 +08:00
2026-07-07 17:35:33 +08:00
2026-07-07 17:35:33 +08:00
2026-06-21 23:54:58 +08:00
2026-07-13 13:22:02 +08:00
2026-07-10 15:55:06 +08:00
2026-07-13 20:07:24 +08:00
2026-07-02 18:31:45 +08:00
2026-06-08 13:08:38 +08:00
2026-07-07 12:01:14 +08:00
2026-07-08 16:00:17 +08:00
2026-06-11 13:00:56 +08:00
2026-07-12 02:53:17 +08:00
2026-07-12 02:53:17 +08:00
2026-07-12 04:00:31 +08:00
2026-07-12 04:00:31 +08:00
2026-07-02 14:38:05 +08:00
2026-07-09 15:07:11 +08:00
2026-07-13 20:07:24 +08:00
2026-07-02 14:38:05 +08:00
2026-06-18 11:10:06 +08:00
2026-07-02 14:38:05 +08:00
2026-07-13 20:07:24 +08:00
2026-07-06 12:34:51 +08:00
2026-07-06 12:34:51 +08:00
2026-07-06 12:34:51 +08:00
2026-06-11 13:00:56 +08:00
2026-06-30 14:46:46 +08:00
2026-06-30 14:46:46 +08:00
2026-06-11 13:00:56 +08:00
2026-07-13 18:13:44 +08:00
2026-06-01 15:19:42 +08:00
2026-06-22 13:34:06 +08:00
2026-07-13 18:13:44 +08:00
2026-06-29 14:09:34 +08:00
2026-07-09 15:07:11 +08:00
2026-06-26 16:01:33 +08:00
2026-06-26 16:01:33 +08:00
2026-06-26 16:01:33 +08:00
2026-07-03 17:42:06 +08:00
2026-07-08 14:51:54 +08:00
2026-07-03 14:18:43 +08:00
2026-06-02 13:03:15 +08:00
2026-07-05 02:35:19 +08:00
2026-07-03 17:42:06 +08:00
2026-07-09 15:10:09 +08:00
2026-05-28 15:53:16 +08:00
2026-07-03 14:18:43 +08:00
2026-06-02 14:29:29 +08:00
2026-06-30 12:29:11 +08:00
2026-06-25 01:29:20 +08:00
2026-07-03 14:18:43 +08:00
2026-06-24 12:46:20 +08:00
2026-07-09 17:59:19 +08:00