mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-02 22:40:22 +00:00
hack to return tool call errors back to model
This commit is contained in:
parent
b05decc572
commit
0a42068fbb
4 changed files with 41 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue