mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-24 03:04:21 +01:00
hack to return tool call errors back to model
This commit is contained in:
@@ -555,6 +555,8 @@ func renderToolName(name string) string {
|
||||
switch name {
|
||||
case "webfetch":
|
||||
return "Fetch"
|
||||
case "invalid":
|
||||
return "Invalid"
|
||||
default:
|
||||
normalizedName := name
|
||||
if after, ok := strings.CutPrefix(name, "opencode_"); ok {
|
||||
@@ -657,6 +659,10 @@ func renderToolTitle(
|
||||
title = getTodoTitle(toolCall)
|
||||
case "todoread":
|
||||
return "Plan"
|
||||
case "invalid":
|
||||
if actualTool, ok := toolArgsMap["tool"].(string); ok {
|
||||
title = renderToolName(actualTool)
|
||||
}
|
||||
default:
|
||||
toolName := renderToolName(toolCall.Tool)
|
||||
title = fmt.Sprintf("%s %s", toolName, toolArgs)
|
||||
|
||||
Reference in New Issue
Block a user