feat: rename execute_command tool, improve go prompt

This commit is contained in:
2025-02-13 01:27:07 +01:00
parent 51f7c2c66f
commit 0617f5ba5b
6 changed files with 20 additions and 19 deletions

View File

@@ -4,7 +4,7 @@ M.run = function(tool_call, conf, prompt_user_tool_accept, is_subpath, read_file
-- Validate the command exists
local cmd = tool_call.command
if not cmd then
return "[executeCommand] Missing 'command'."
return "[execute_command] Missing 'command'."
end
-- Capture stderr and stdout together by redirecting stderr to stdout
@@ -14,7 +14,7 @@ M.run = function(tool_call, conf, prompt_user_tool_accept, is_subpath, read_file
-- Attempt to popen the command
local handle = io.popen(cmd, "r")
if not handle then
return string.format("Tool [executeCommand '%s'] FAILED to popen.", cmd)
return string.format("Tool [execute_command '%s'] FAILED to popen.", cmd)
end
-- Read the full output (stdout + stderr)
@@ -25,7 +25,7 @@ M.run = function(tool_call, conf, prompt_user_tool_accept, is_subpath, read_file
-- Provide a richer summary including exit code and reason
return string.format(
"Tool [executeCommand '%s'] exited with code %s (%s)\n%s",
"Tool [execute_command '%s'] exited with code %s (%s)\n%s",
cmd,
tostring(exit_code),
tostring(exit_reason),