mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-18 03:37:33 +08:00
Refactor runtime around world core
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/YspCoder/clawgo/pkg/config"
|
||||
)
|
||||
@@ -68,29 +67,6 @@ 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) {
|
||||
return "ok", nil
|
||||
})
|
||||
tool := NewSpawnTool(manager)
|
||||
|
||||
out, err := tool.Execute(context.Background(), map[string]interface{}{
|
||||
"task": "implement check",
|
||||
"agent_id": "coder",
|
||||
"max_retries": "2",
|
||||
"retry_backoff_ms": "100",
|
||||
"timeout_sec": "5",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("spawn failed: %v", err)
|
||||
}
|
||||
if !strings.Contains(out, "spawned") && !strings.Contains(strings.ToLower(out), "subagent") {
|
||||
t.Fatalf("unexpected spawn output: %s", out)
|
||||
}
|
||||
time.Sleep(50 * time.Millisecond)
|
||||
}
|
||||
|
||||
func TestExecBrowserWebToolsParseStringArgs(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user