implemented shell_exec

This commit is contained in:
Luxferre
2026-03-21 17:11:17 +02:00
parent a2af89e61f
commit 6e2294cb48
6 changed files with 101 additions and 2 deletions
+16
View File
@@ -79,6 +79,22 @@ func TestDelegation(t *testing.T) {
if ans != "Coord done" { t.Errorf("expected Coord done, got %s", ans) }
}
func TestShellExecRegistration(t *testing.T) {
// Scenario 1: Disabled (default)
c1 := AgentConfig{ID: "a1", EnableShellExec: false}
a1 := NewSidekick(c1, ModelConfig{}, nil)
if _, ok := a1.ToolRegistry["shell_exec"]; ok {
t.Errorf("shell_exec should be disabled by default")
}
// Scenario 2: Enabled
c2 := AgentConfig{ID: "a2", EnableShellExec: true}
a2 := NewSidekick(c2, ModelConfig{}, nil)
if _, ok := a2.ToolRegistry["shell_exec"]; !ok {
t.Errorf("shell_exec should be enabled when EnableShellExec is true")
}
}
func TestTempFileCleanup(t *testing.T) {
threshold := 10
a := NewSidekick(AgentConfig{MaxIterations: 2, ToolResponseThreshold: threshold}, ModelConfig{}, nil)