Slim subagent runtime surface and remove legacy interfaces

This commit is contained in:
LPF
2026-03-17 13:41:12 +08:00
parent 341e578c9f
commit 0674d85ae1
76 changed files with 778 additions and 8782 deletions

View File

@@ -2,6 +2,8 @@ package tools
import (
"context"
"os/exec"
"runtime"
"strings"
"testing"
"time"
@@ -70,7 +72,7 @@ func TestFilesystemToolsParseStringArgs(t *testing.T) {
func TestSpawnToolParsesStringNumbers(t *testing.T) {
manager := NewSubagentManager(nil, t.TempDir(), nil)
manager.SetRunFunc(func(ctx context.Context, task *SubagentTask) (string, error) {
manager.SetRunFunc(func(ctx context.Context, run *SubagentRun) (string, error) {
return "ok", nil
})
tool := NewSpawnTool(manager)
@@ -95,8 +97,14 @@ func TestExecBrowserWebToolsParseStringArgs(t *testing.T) {
t.Parallel()
execTool := NewExecTool(configShellForTest(), t.TempDir(), NewProcessManager(t.TempDir()))
command := "printf hi"
if runtime.GOOS == "windows" {
if _, err := exec.LookPath("sh"); err != nil {
t.Skip("sh is not available in test environment")
}
}
execOut, err := execTool.Execute(context.Background(), map[string]interface{}{
"command": "printf hi",
"command": command,
"background": "false",
})
if err != nil {