Skip to content

Commit f9d7cd2

Browse files
committed
Fix #585
Signed-off-by: David Gageot <[email protected]>
1 parent 897a0a2 commit f9d7cd2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/tools/builtin/script_shell.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,10 @@ func (t *ScriptShellTool) Tools(context.Context) ([]tools.Tool, error) {
104104

105105
func (t *ScriptShellTool) execute(ctx context.Context, toolConfig *latest.ScriptShellToolConfig, toolCall tools.ToolCall) (*tools.ToolCallResult, error) {
106106
var params map[string]any
107-
if err := json.Unmarshal([]byte(toolCall.Function.Arguments), &params); err != nil {
108-
return nil, fmt.Errorf("invalid arguments: %w", err)
107+
if toolCall.Function.Arguments != "" {
108+
if err := json.Unmarshal([]byte(toolCall.Function.Arguments), &params); err != nil {
109+
return nil, fmt.Errorf("invalid arguments: %w", err)
110+
}
109111
}
110112

111113
// Use default shell

0 commit comments

Comments
 (0)