Scope workspace tasks to the bot that has them

A workspace's task now carries the bot that has it there (bot_id with
workspace_id), or none while it's shared. A bot reaches its own list and,
in its workspaces, its own tasks plus the shared ones; a workspace admin
every task there. Bots create workspace tasks for themselves by default,
take a shared one by starting it, and hand-overs record the new bot.
Removing or deleting a bot makes its workspace tasks shared again. The
conversation's Tasks modal shows that bot's tasks in the workspace.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-27 19:19:01 +01:00
co-authored by Claude Opus 5.5
parent 184407d76b
commit 864dcce30a
31 changed files with 316 additions and 153 deletions
@@ -17,7 +17,7 @@ type Params = {
is_coordinator: boolean;
/**
* The workspaces the bot is admin of (`grabBotRunPowers`): in one of
* them, create_task can also add to the other members' own lists.
* them, create_task can also give tasks there to the other members.
*/
admin_workspace_ids?: number[];
workspace_id?: number | string | null;
@@ -25,11 +25,11 @@ type Params = {
/**
* The task tools every run gets (`src/harness/tools/bot/tasks/`): the
* shared to-do list, one per bot and one per workspace, so a chat reply, a
* task and a scheduled run all read it, move it along and file what they
* produced. The coordinator's create_task may target any worker or
* workspace; its update_task may link any file it can reach. A workspace
* admin's may add to the other members' own lists there.
* to-do list (a bot's own, and in each workspace its tasks there and the
* shared ones), so a chat reply, a task and a scheduled run all read it,
* move it along and file what they produced. The coordinator's create_task
* may target any worker or workspace; its update_task may link any file it
* can reach. A workspace admin's may give tasks there to the other members.
*/
export default async function grabBotTaskTools({
user_id,