diff options
| author | Adam Malczewski <[email protected]> | 2026-06-02 15:55:12 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-02 15:55:12 +0900 |
| commit | e4379da8d1e8c7a8a89c63bdaaef99a74bf56cf2 (patch) | |
| tree | 652c8bea110add9447057d0f2bf4038e91d39877 /packages | |
| parent | aa295e82197ebc77d9466eee28380bc5bcc0863d (diff) | |
| download | dispatch-e4379da8d1e8c7a8a89c63bdaaef99a74bf56cf2.tar.gz dispatch-e4379da8d1e8c7a8a89c63bdaaef99a74bf56cf2.zip | |
fix(tabs): say a reply will WAKE you with a new message (clearer than 'arrives on its own')
Matches actual behavior: a peer's reply wakes this tab with a new message in a
later turn. Updated the send_to_tab description (both canReadTab branches), the
delivery-result text (both branches), and the system-prompt one-liner; updated
the test assertion accordingly.
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/api/src/agent-manager.ts | 2 | ||||
| -rw-r--r-- | packages/core/src/tools/send-to-tab.ts | 10 | ||||
| -rw-r--r-- | packages/core/tests/tools/send-to-tab.test.ts | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/packages/api/src/agent-manager.ts b/packages/api/src/agent-manager.ts index 3d233fc..684f8ec 100644 --- a/packages/api/src/agent-manager.ts +++ b/packages/api/src/agent-manager.ts @@ -84,7 +84,7 @@ const TOOL_DESCRIPTIONS: Record<string, string> = { youtube_transcribe: "Fetch the transcript/subtitles for a YouTube video. Set background=true to start in the background and get a job_id for later retrieval.", send_to_tab: - "Send a message to another tab (agent) by its short ID, as shown in the tab bar. Fire-and-forget: it queues/wakes the target and returns immediately without waiting for a reply. Do NOT sleep, poll, or run commands to wait — a reply arrives on its own in a later turn; if you are only waiting, end your turn.", + "Send a message to another tab (agent) by its short ID, as shown in the tab bar. Fire-and-forget: it queues/wakes the target and returns immediately without waiting for a reply. Do NOT sleep, poll, or run commands to wait — if the target replies it will wake you with a new message in a later turn; if you are only waiting, end your turn.", read_tab: "Read another tab (agent)'s most recent completed response by its short ID. Returns a non-blocking snapshot; if the target is still running you get its previous completed turn. Use after send_to_tab to collect a reply.", }; diff --git a/packages/core/src/tools/send-to-tab.ts b/packages/core/src/tools/send-to-tab.ts index 50023a7..eae6bfa 100644 --- a/packages/core/src/tools/send-to-tab.ts +++ b/packages/core/src/tools/send-to-tab.ts @@ -63,11 +63,11 @@ function renderOpenHandles(handles: Array<{ handle: string; title: string }>): s export function createSendToTabTool(callbacks: SendToTabCallbacks): ToolDefinition { // The `read_tab` follow-up hint is only truthful when this tab actually // holds the `read_tab` tool (the permissions are split). When it doesn't, - // the only honest guidance is that a reply arrives on its own — never tell + // the only honest guidance is that a reply will wake it as a new message — never tell // the agent to call a tool it wasn't granted. const waitLine = callbacks.canReadTab - ? "money. If the target replies it arrives on its own as a new message in a later turn; you" - : "money. If the target replies it arrives on its own as a new message in a later turn."; + ? "money. If the target replies it will WAKE you with a new message in a later turn; you" + : "money. If the target replies it will WAKE you with a new message in a later turn."; const readTabLine = callbacks.canReadTab ? ["can also call 'read_tab' with the same ID in a FUTURE turn to check. If you have other"] : []; @@ -176,13 +176,13 @@ export function createSendToTabTool(callbacks: SendToTabCallbacks): ToolDefiniti const tail = callbacks.canReadTab ? [ "Do NOT sleep, poll, or run commands to wait for a reply. If the target replies it", - `arrives on its own as a new message later; you can also call read_tab with "${target.handle}"`, + `will WAKE you with a new message later; you can also call read_tab with "${target.handle}"`, "in a FUTURE turn to check. Keep working if you have other tasks; if you are ONLY", "waiting for this reply, end your turn now.", ] : [ "Do NOT sleep, poll, or run commands to wait for a reply. If the target replies it", - "arrives on its own as a new message later. Keep working if you have other tasks; if", + "will WAKE you with a new message later. Keep working if you have other tasks; if", "you are ONLY waiting for this reply, end your turn now.", ]; return [ diff --git a/packages/core/tests/tools/send-to-tab.test.ts b/packages/core/tests/tools/send-to-tab.test.ts index 48ff460..21d8032 100644 --- a/packages/core/tests/tools/send-to-tab.test.ts +++ b/packages/core/tests/tools/send-to-tab.test.ts @@ -38,8 +38,8 @@ describe("createSendToTabTool — schema & description", () => { it("never mentions read_tab in the description when canReadTab is false", () => { const tool = createSendToTabTool(makeCallbacks({ canReadTab: false })); expect(tool.description).not.toContain("read_tab"); - // Still tells the agent a reply arrives on its own + to end its turn. - expect(tool.description.toLowerCase()).toContain("arrives on its own"); + // Still tells the agent a reply will wake it + to end its turn. + expect(tool.description.toLowerCase()).toContain("wake you with a new message"); expect(tool.description.toLowerCase()).toContain("end your turn"); }); }); |
