Let the coordinator and workspace admins hand over tasks and routines

delegate_task takes a task_id to hand over a task already on a list: it
moves to the worker (a workspace's task stays on its list), goes to
doing, and the job is linked back so its end is noted on the task.
hand_over_schedule moves a bot's own routine to another bot, keeping its
workspace. Users get Hand over in the Tasks UI and both routine lists.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-25 11:23:26 +01:00
co-authored by Claude Opus 5.5
parent b4283b607e
commit 93896646c7
36 changed files with 1334 additions and 94 deletions
+19 -1
View File
@@ -10,6 +10,7 @@ import assignComputerTool from "./assign-computer-tool";
import createBotTool from "./create-bot-tool";
import createWorkspaceTool from "./create-workspace-tool";
import delegateTaskTool from "./delegate-task-tool";
import handOverScheduleTool from "./hand-over-schedule-tool";
import deleteBotTool from "./delete-bot-tool";
import deleteWorkspaceTool from "./delete-workspace-tool";
import findBotTool from "./find-bot-tool";
@@ -81,7 +82,7 @@ type Params = {
* update_workspace (a workspace and its shared context), create_bot to
* grow the crew, delegate_task to every worker (the workspace's in a
* workspace, where the task runs; from its own chat, in the worker's own
* chat or in a workspace it names) plus, in its own chat, find_bot and
* chat or in a workspace it names) and hand_over_schedule beside it, plus, in its own chat, find_bot and
* find_workspace,
* add_bot_to_workspace and remove_bot_from_workspace, assign_computer,
* update_bot, delete_bot and delete_workspace (which workspace, which
@@ -172,6 +173,14 @@ export default async function grabBotChatTools({
workspace_id,
requester_name: bot.name || "The coordinator",
workers,
is_coordinator: true,
}));
tools.push(handOverScheduleTool({
user_id,
bot_id,
workspace_id,
requester_name: bot.name || "The coordinator",
workers,
}));
tools.push(setWorkspaceInstructionsTool({ user_id, workspace_id, workers }));
@@ -203,6 +212,15 @@ export default async function grabBotChatTools({
requester_name: bot.name || "The coordinator",
workers,
workspaces,
is_coordinator: true,
}),
handOverScheduleTool({
user_id,
bot_id,
workspace_id,
requester_name: bot.name || "The coordinator",
workers,
workspaces,
}),
);