hack to return tool call errors back to model

This commit is contained in:
Dax Raad
2025-08-04 11:59:42 -04:00
parent b05decc572
commit 0a42068fbb
4 changed files with 41 additions and 0 deletions

View File

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