mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-14 22:09:37 +08:00
feat: ship subagent runtime and remove autonomy/task legacy
This commit is contained in:
31
pkg/tools/tool_allowlist_groups_test.go
Normal file
31
pkg/tools/tool_allowlist_groups_test.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package tools
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestExpandToolAllowlistEntries_GroupPrefix(t *testing.T) {
|
||||
got := ExpandToolAllowlistEntries([]string{"group:files_read"})
|
||||
contains := map[string]bool{}
|
||||
for _, item := range got {
|
||||
contains[item] = true
|
||||
}
|
||||
if !contains["read_file"] || !contains["list_dir"] {
|
||||
t.Fatalf("files_read group expansion missing expected tools: %v", got)
|
||||
}
|
||||
if contains["write_file"] {
|
||||
t.Fatalf("files_read group should not include write_file: %v", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestExpandToolAllowlistEntries_BareGroupAndAlias(t *testing.T) {
|
||||
got := ExpandToolAllowlistEntries([]string{"memory_all", "@pipeline"})
|
||||
contains := map[string]bool{}
|
||||
for _, item := range got {
|
||||
contains[item] = true
|
||||
}
|
||||
if !contains["memory_search"] || !contains["memory_write"] {
|
||||
t.Fatalf("memory_all expansion missing memory tools: %v", got)
|
||||
}
|
||||
if !contains["pipeline_dispatch"] || !contains["pipeline_status"] {
|
||||
t.Fatalf("pipeline alias expansion missing pipeline tools: %v", got)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user