summaryrefslogtreecommitdiffhomepage
path: root/packages/api/src
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-02 15:30:42 +0900
committerAdam Malczewski <[email protected]>2026-06-02 15:30:42 +0900
commit9c89ec9db22d0a7226c36b62640addc00918029b (patch)
tree35ae0c91b27ec7e6aeea7800f8987fe1db268950 /packages/api/src
parentc0c08720cceb75b5e635e71190ae1f956f535133 (diff)
downloaddispatch-9c89ec9db22d0a7226c36b62640addc00918029b.tar.gz
dispatch-9c89ec9db22d0a7226c36b62640addc00918029b.zip
fix(tabs): advertise send_to_tab/read_tab in the agent system prompt
Granted tab-messaging tools were registered in the API tool payload but buildSystemPrompt built its 'You have access to the following tools' list by filtering toolNames through TOOL_DESCRIPTIONS, which had no entries for send_to_tab/read_tab. The model was therefore told it lacked those tools and refused to use them even when explicitly granted. Add the two missing TOOL_DESCRIPTIONS entries so the capability list matches the granted toolset. Add regression tests that capture the constructed Agent's systemPrompt and assert the tab-messaging tools are listed when granted (and omitted when not), locking the prompt list to the schema list so they can't drift again.
Diffstat (limited to 'packages/api/src')
-rw-r--r--packages/api/src/agent-manager.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/api/src/agent-manager.ts b/packages/api/src/agent-manager.ts
index 85dd160..36a26f8 100644
--- a/packages/api/src/agent-manager.ts
+++ b/packages/api/src/agent-manager.ts
@@ -83,6 +83,10 @@ const TOOL_DESCRIPTIONS: Record<string, string> = {
web_search: "Search the web and optionally scrape full page content from results.",
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. Use read_tab later to read the target's response.",
+ 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.",
};
/**