implemented shell_exec
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user