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
This commit is contained in:
opencode-agent[bot] 2025-08-19 18:36:21 +00:00
parent 863ae6fa7d
commit bae929c38a

View file

@ -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)