diff options
| author | Adam Malczewski <[email protected]> | 2026-05-23 04:18:54 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-05-23 04:18:54 +0900 |
| commit | 80ce5960c479fe35ab72c822e3b67799d7e1491e (patch) | |
| tree | 2b58bb1cfbc458a70ad021adc1ce0ae6ed810d84 /packages/core/src/tools/retrieve.ts | |
| parent | c47346cc6237044ecb60ff22c4011d89744af581 (diff) | |
| download | dispatch-80ce5960c479fe35ab72c822e3b67799d7e1491e.tar.gz dispatch-80ce5960c479fe35ab72c822e3b67799d7e1491e.zip | |
feat: web_search + youtube_transcribe tools, shell interrupt backgrounding, fixes
- Add web_search tool (Firecrawl POST to /v1/search with query, limit, lang, country, scrapeOptions)
- Add youtube_transcribe tool (GET to transcriber service, handles completed/queued/failed statuses)
- Both tools registered for parent agents (always) and child agents (permission-gated)
- Added to summon enum, TOOL_DESCRIPTIONS, and core exports
- Shell interrupt: run_shell now races against user queue interrupt
- When interrupted, command continues in background with run_shell_<uuid> job ID
- BackgroundShellStore holds running processes, auto-cleans 10min after completion
- retrieve tool extended to handle both agent IDs and shell job IDs
- Tool error detection: results starting with 'Error:' now marked isError in UI
- Fix TS error: cast unavailMatch[1] regex capture group to string
- Docker: network_mode host for Tailscale/LAN access to external services
- Bun.serve idleTimeout set to 60s (was default 10s)
- KeyUsage: clearer message when OpenCode usage data unavailable
- Firecrawl: only send scrapeOptions when scrape=true (avoid 400 on instances without scrape support)
Diffstat (limited to 'packages/core/src/tools/retrieve.ts')
| -rw-r--r-- | packages/core/src/tools/retrieve.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/packages/core/src/tools/retrieve.ts b/packages/core/src/tools/retrieve.ts index 8e14a96..021d1b7 100644 --- a/packages/core/src/tools/retrieve.ts +++ b/packages/core/src/tools/retrieve.ts @@ -11,15 +11,19 @@ export function createRetrieveTool(callbacks: RetrieveCallbacks): ToolDefinition return { name: "retrieve", description: [ - "Wait for a child agent to finish and retrieve its result. This tool BLOCKS until the child completes.", + "Wait for a child agent or backgrounded shell command to finish and retrieve its result. This tool BLOCKS until completion.", "", - "Pass the agent_id returned by the summon tool. Once the child finishes, its final output is returned.", - "If the child encountered an error, the error message is returned instead.", + "Pass the ID returned by summon (agent_id) or by an interrupted run_shell (job_id). Once it finishes, the output is returned.", + "If an error occurred, the error message is returned instead.", "", "Typical usage:", ' 1. summon({ task: "...", tools: [...] }) -> get agent_id', " 2. ... do other work or summon more agents ...", ' 3. retrieve({ agent_id: "..." }) -> blocks until done, returns result', + "", + "Also used for backgrounded shell commands:", + " If run_shell is interrupted by a user message, it returns a job_id (run_shell_...).", + ' Use retrieve({ agent_id: "run_shell_..." }) to get the final output when ready.', ].join("\n"), parameters: z.object({ agent_id: z.string().describe("The agent_id returned by a previous summon call."), |
