GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: prevent opencode run crash on malformed tool inputs (#13051) · un33k/opencode@d018903

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/opencode/src/cli/cmd
    • run.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/opencode/src/cli/cmd/run.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/cli/cmd/run.ts
+18-14Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -406,20 +406,24 @@ export const RunCommand = cmd({
406406

407407
async function execute(sdk: OpencodeClient) {
408408
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+
}
423427
}
424428

425429
function emit(type: string, data: Record<string, unknown>) {

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.