Sfoglia il codice sorgente

fix: add type checking for MCP tool path parameters (#2073)

Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Aiden Cline 6 mesi fa
parent
commit
ad76d7e57d
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      packages/tui/internal/components/chat/message.go

+ 3 - 1
packages/tui/internal/components/chat/message.go

@@ -903,7 +903,9 @@ func renderArgs(args *map[string]any, titleKey string) string {
 			continue
 		}
 		if key == "filePath" || key == "path" {
-			value = util.Relative(value.(string))
+			if strValue, ok := value.(string); ok {
+				value = util.Relative(strValue)
+			}
 		}
 		if key == titleKey {
 			title = fmt.Sprintf("%s", value)