Give every task a bot: drop shared workspace tasks

A workspace task with no bot was seen by every bot working there. Now a
task can't be saved without a bot, a worker reaches only its own (the
workspace admin and the coordinator still reach all), the workspace page
picks who has a new task, and a bot leaving a workspace or deleted passes
its tasks there to the workspace's admin bot, else the coordinator (also
at boot for rows without a bot).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-28 06:26:44 +01:00
co-authored by Claude Opus 5.5
parent 3e78d51b56
commit 623112fd19
30 changed files with 239 additions and 106 deletions
+4
View File
@@ -10,6 +10,7 @@ import fileIngest from "./file-ingest";
import liveRelay from "./live-relay";
import enableForeignKeys from "./functions/backend/db/enable-foreign-keys";
import migrateBotTypes from "./functions/backend/db/bot-types/migrate-bot-types";
import assignOwnerlessTasks from "./functions/backend/db/tasks/assign-ownerless-tasks";
import clearImplicitSessionLinks from "./functions/backend/db/bot-sessions/clear-implicit-session-links";
import dropStoredFileText from "./functions/backend/db/stored-text/drop-stored-file-text";
import syncKnowledgebaseFts from "./functions/backend/db/knowledgebases/fts/sync-knowledgebase-fts";
@@ -38,6 +39,9 @@ await enableForeignKeys();
await migrateBotTypes().catch((error) =>
logError({ title: "Could not migrate bot types", error }).catch(() => {}),
);
await assignOwnerlessTasks().catch((error) =>
logError({ title: "Could not assign tasks without a bot", error }).catch(() => {}),
);
await clearImplicitSessionLinks().catch((error) =>
logError({ title: "Could not clear implicit session links", error }).catch(() => {}),
);