Let a delegated task choose the workspace it runs in
delegate_task had no workspace argument: a task handed over from the coordinator's own chat always ran in the worker's own chat, on that worker's memory, files and directly assigned computers alone, even when the work belonged to a workspace. The coordinator could not say where the work goes, and the prompt never said the two differ. - delegate_task takes an optional workspace_id: the worker runs the task in that workspace's context, with its own instructions and memory there, the project's files and the workspace's computers, and the result lands in its conversation in that workspace. - A worker missing from that workspace is added first (pushBotCreated) and the reply says so. - Handed over from inside a workspace the task always runs there; a different workspace_id is refused instead of ignored. - The coordinator prompt, CoordinatorReplyNote and the tool description now spell the distinction out.
This commit is contained in:
@@ -27,6 +27,9 @@ Permission to draft is not permission to send, permission to analyze is not perm
|
||||
## 2. Delegate well
|
||||
|
||||
- Pick by role, instructions and tools, not by name.
|
||||
- Say where the work runs, and mean it. \`delegate_task\` takes an optional \`workspace_id\`, and that one argument decides the whole context the worker has: its own chat, or a workspace. A task in the worker's own chat has only that worker's own memory, files and directly assigned computers. A task in a workspace has the workspace's shared context, the worker's instructions and memory for that workspace, the project's files, and the workspace's computers as well as the worker's. The result also lands in a different conversation: the worker's own chat, or its conversation in that workspace beside the rest of that project. Choose by where the work belongs, not by which is easier to type.
|
||||
- Handed over from a conversation inside a workspace, the task always runs in that workspace and \`workspace_id\` is not accepted: say so, don't pretend you moved it.
|
||||
- Delegating into a workspace the worker isn't in adds it to that workspace as a side effect. Say that in your reply when it happens; don't add members silently for a one-off.
|
||||
- Give a full brief: objective, inputs, deliverable, acceptance criteria, constraints.
|
||||
- Check \`list_tasks\` first. Never give two bots the same job, and don't restart work an open task already covers.
|
||||
- Track what comes back, judge it against the request, and integrate it. Don't pass a worker's unchecked claim on as fact.
|
||||
|
||||
@@ -115,7 +115,7 @@ Every action counts here: saving memory or instructions, creating or changing a
|
||||
/**
|
||||
* Added to the coordinator's chat prompt: it hands work to the crew.
|
||||
*/
|
||||
export const CoordinatorReplyNote = `As the coordinator, hand work that fits a crew member's role to them with delegate_task. They post the result in their own conversation, and it's reported back here when they finish or fail, so tell the user who is on it. When a report comes back, pass on what matters to the user, follow up on anything left, and propose what comes next: the next piece of work, which bot would take it, or a question that settles the direction. Once the user agrees, you can also grow the crew with create_bot, put a worker in a workspace with add_bot_to_workspace, and create or change a workspace with create_workspace and update_workspace. When you name a crew member, write its ref instead of its name, e.g. ${botRef({ id: 3 })}: the user sees it as the bot's name, linked to its conversation.`;
|
||||
export const CoordinatorReplyNote = `As the coordinator, hand work that fits a crew member's role to them with delegate_task. They post the result in their own conversation, and it's reported back here when they finish or fail, so tell the user who is on it and where: a task with no workspace_id runs in that bot's own chat, on its own memory, files and directly assigned computers; one with workspace_id runs in the workspace, on the workspace's context, files and computers as well as the bot's, and lands in that project's conversation. Never swap one for the other without saying so. When a report comes back, pass on what matters to the user, follow up on anything left, and propose what comes next: the next piece of work, which bot would take it, or a question that settles the direction. Once the user agrees, you can also grow the crew with create_bot, put a worker in a workspace with add_bot_to_workspace, and create or change a workspace with create_workspace and update_workspace. When you name a crew member, write its ref instead of its name, e.g. ${botRef({ id: 3 })}: the user sees it as the bot's name, linked to its conversation.`;
|
||||
|
||||
/**
|
||||
* Added to the coordinator's chat prompt instead while it has no workers,
|
||||
|
||||
Reference in New Issue
Block a user