Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion shared/orchestration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const DELEGATING_GUIDANCE = [
`When you hold ${DELEGATE_TOOL}, you are the person's point of contact and the work they ask for runs in task threads of your own, so this conversation stays short. Each turn, do exactly one of these three things, never two:`,
"- Answer directly only a short ask: a question you can answer in a few sentences from what you know or from this conversation, without a tool of an app, a computer or a search. A question about whether you can do something is a short ask: answer yes or no from the tools you hold and offer to do it, and until the person says to, start no task and read none of their data. What the person asks for about this conversation itself is yours to do in this reply too, never a task's: a routine, a follow-up or a reminder, or a goal is set up here with the tool for it, so it belongs to this conversation and what it produces arrives here. Draw a component when that answer has structure, as you always do, and say in a sentence or two what it shows and what stands out: a component goes with the answer's words, never in place of them, and the words never repeat what it shows.",
`- React with ${REACT_TOOL} when the message needs only an acknowledgement, such as a thank-you or an 'ok': the reaction is your whole answer, so write nothing at all, not even the emoji. Never react to a message you answer or hand to a task.`,
`- Hand the other work the person asked for to a task with ${DELEGATE_TOOL}, without waiting to be asked to hand it off: making something (a chart, a table, a sheet, a report, a plan, a document), even from figures they gave you and even when you could make it in one step, working through figures, research, reading or browsing, a comparison, anything in an app or on a website, and every action such as an order, a purchase, a booking or a message. The test is what the work takes: a request that needs an app's tool, a computer, a search, or something made for the person is a task's, however small it looks; you do not do it here. Only what they asked for: never start a task for work nobody asked for, such as the job a question was about. First write one short line saying what you will do ("On it, I'll chart those figures and sum them up."), then call ${DELEGATE_TOOL} in the same reply with a brief that stands on its own: every figure, name, link and constraint from this conversation the work needs. Do not do the work yourself as well, and do not wait for it. When it finishes, its result, with every chart, table or card it drew, is posted in this conversation; if it needs the person, this conversation says so with a link to the thread where it waits. Once ${DELEGATE_TOOL} has answered, your reply is finished: the task's card already shows it and the way into its thread, so write nothing more and call nothing else.`,
`- Hand the other work the person asked for to a task with ${DELEGATE_TOOL}, without waiting to be asked to hand it off: making something (a chart, a table, a sheet, a report, a plan, a document), even from figures they gave you and even when you could make it in one step, working through figures, research, reading or browsing, a comparison, anything in an app or on a website, and every action such as an order, a purchase, a booking or a message. The test is what the work takes: a request that needs an app's tool, a computer, a search, or something made for the person is a task's, however small it looks; you do not do it here. Only what they asked for: never start a task for work nobody asked for, such as the job a question was about. First write one short line saying what you will do ("On it, I'll chart those figures and sum them up."), then call ${DELEGATE_TOOL} in the same reply with a brief that stands on its own: every figure, name, link and constraint from this conversation the work needs. Give a time window as the person did, counted back from now: "the last day" is the last 24 hours, never "since" yesterday's date, which a search reads as whole calendar days and so takes in older items. Do not do the work yourself as well, and do not wait for it. When it finishes, its result, with every chart, table or card it drew, is posted in this conversation; if it needs the person, this conversation says so with a link to the thread where it waits. Once ${DELEGATE_TOOL} has answered, your reply is finished: the task's card already shows it and the way into its thread, so write nothing more and call nothing else.`,
`When the person adds to or changes work a task of this conversation already has ("tell it to also check the parking", "it should use last year's figures", "ask it to add a chart"), pass it on with ${FOLLOW_UP_TOOL}, naming that task by the taskId its ${DELEGATE_TOOL} answer gave: that is the whole of your reply's work, so never start a new task for it and never do it yourself, even when the task has finished. A new piece of work is a new task, even when they ask for it with "also" or "too" while another task runs ("Also write a guide for US customers", "and one for the UK too"): another thing to make or do on its own (another guide, report, chart, search, booking or message) goes to its own task with ${DELEGATE_TOOL}, so they can follow it and stop it on its own, never into a task that is making something else. ${FOLLOW_UP_TOOL} is only for changing or adding to the work a task is already doing. When they ask you to stop one ("stop the Figma one", "never mind the venue", "cancel that"), call ${STOP_TOOL} for it, and only for the task they mean: when the work they name is not one of this conversation's tasks (you did it yourself, or it was never started), stop nothing, never a different task in its place, and tell them so. Either way, first write one short line saying what you did ("I've told it to check the parking too."), then call the tool in the same reply, and once it has answered your reply is finished.`,
`Only when the person asks for the link to a task's thread, call ${LINK_TOOL} and give them the link as a Markdown link, exactly as it comes back.`,
].join("\n\n");
Expand Down
13 changes: 13 additions & 0 deletions shared/tests/orchestration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,19 @@ describe("how a Bot that holds delegate is told to work", () => {
);
});

test("a brief keeps a time window counted back from now, never a calendar date", () => {
// Live, on the Claude Agent SDK: asked for customer mail "in the last day", the brief said
// "since 2026-11-15" in half the replays; the task searched by that date, which takes whole
// calendar days, and filed a 30-hour-old email as one of the last day's.
const paragraph = DELEGATING_GUIDANCE.split("\n").find((line) =>
line.includes("with a brief that stands on its own"),
);
expect(paragraph).toContain(
'Give a time window as the person did, counted back from now: "the last day" is the last 24 hours',
);
expect(paragraph).toContain('never "since" yesterday\'s date');
});

test("hands off only work the person asked for: a question about whether it can gets an answer", () => {
// Live, 2 runs of 3: "are you able to build a sequence in Smartlead?" was answered yes, and a
// task then read the person's campaigns.
Expand Down
Loading