@@ -406,20 +406,24 @@ export const RunCommand = cmd({ |
406 | 406 |
|
407 | 407 | async function execute(sdk: OpencodeClient) { |
408 | 408 | function tool(part: ToolPart) { |
409 | | - if (part.tool === "bash") return bash(props<typeof BashTool>(part)) |
410 | | - if (part.tool === "glob") return glob(props<typeof GlobTool>(part)) |
411 | | - if (part.tool === "grep") return grep(props<typeof GrepTool>(part)) |
412 | | - if (part.tool === "list") return list(props<typeof ListTool>(part)) |
413 | | - if (part.tool === "read") return read(props<typeof ReadTool>(part)) |
414 | | - if (part.tool === "write") return write(props<typeof WriteTool>(part)) |
415 | | - if (part.tool === "webfetch") return webfetch(props<typeof WebFetchTool>(part)) |
416 | | - if (part.tool === "edit") return edit(props<typeof EditTool>(part)) |
417 | | - if (part.tool === "codesearch") return codesearch(props<typeof CodeSearchTool>(part)) |
418 | | - if (part.tool === "websearch") return websearch(props<typeof WebSearchTool>(part)) |
419 | | - if (part.tool === "task") return task(props<typeof TaskTool>(part)) |
420 | | - if (part.tool === "todowrite") return todo(props<typeof TodoWriteTool>(part)) |
421 | | - if (part.tool === "skill") return skill(props<typeof SkillTool>(part)) |
422 | | - return fallback(part) |
| 409 | + try { |
| 410 | + if (part.tool === "bash") return bash(props<typeof BashTool>(part)) |
| 411 | + if (part.tool === "glob") return glob(props<typeof GlobTool>(part)) |
| 412 | + if (part.tool === "grep") return grep(props<typeof GrepTool>(part)) |
| 413 | + if (part.tool === "list") return list(props<typeof ListTool>(part)) |
| 414 | + if (part.tool === "read") return read(props<typeof ReadTool>(part)) |
| 415 | + if (part.tool === "write") return write(props<typeof WriteTool>(part)) |
| 416 | + if (part.tool === "webfetch") return webfetch(props<typeof WebFetchTool>(part)) |
| 417 | + if (part.tool === "edit") return edit(props<typeof EditTool>(part)) |
| 418 | + if (part.tool === "codesearch") return codesearch(props<typeof CodeSearchTool>(part)) |
| 419 | + if (part.tool === "websearch") return websearch(props<typeof WebSearchTool>(part)) |
| 420 | + if (part.tool === "task") return task(props<typeof TaskTool>(part)) |
| 421 | + if (part.tool === "todowrite") return todo(props<typeof TodoWriteTool>(part)) |
| 422 | + if (part.tool === "skill") return skill(props<typeof SkillTool>(part)) |
| 423 | + return fallback(part) |
| 424 | + } catch { |
| 425 | + return fallback(part) |
| 426 | + } |
423 | 427 | } |
424 | 428 |
|
425 | 429 | function emit(type: string, data: Record<string, unknown>) { |
|