fix: skillscript.Run ignores context, cannot be canceled/timed out (archie)

Fixes #45
This commit is contained in:
archie committed 2026-07-27 02:41:44 +00:00
1 parent c3aa0a0a02
commit ce0fc1fac0
2 files changed
+61 -17

No files matched your search

+2 -2
View File
@@ -210,7 +210,7 @@ func scriptToolSet(workspace string) core.ToolSet {
"run_go_script",
"Run a Yaegi-interpreted Go script (e.g. a skill's bundled scripts/*.go helper) and return everything it printed.",
json.RawMessage(params),
func(_ context.Context, input string) (string, error) {
func(ctx context.Context, input string) (string, error) {
var args struct {
Path string `json:"path"`
}
@@ -221,7 +221,7 @@ func scriptToolSet(workspace string) core.ToolSet {
if rel, err := filepath.Rel(workspace, full); err != nil || strings.HasPrefix(rel, "..") {
return "run_go_script rejected: path escapes the workspace", nil
}
out, err := skillscript.Run(full)
out, err := skillscript.RunContext(ctx, full)
if err != nil {
return fmt.Sprintf("run_go_script failed: %v\n%s", err, out), nil
}