From bae929c38a0799ea6604670d90513b30dc273bc5 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" Date: Tue, 19 Aug 2025 18:36:21 +0000 Subject: [PATCH] fix: add type checking for MCP tool path parameters Prevents panic when MCP servers send path parameters as arrays instead of strings by safely checking the type before conversion --- packages/tui/internal/components/chat/message.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/tui/internal/components/chat/message.go b/packages/tui/internal/components/chat/message.go index 15db3753..65c476e1 100644 --- a/packages/tui/internal/components/chat/message.go +++ b/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)