mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-06 10:08:58 +08:00
feat: ship subagent runtime and remove autonomy/task legacy
This commit is contained in:
@@ -42,3 +42,23 @@ func TestEnsureToolAllowedByContextParallelNested(t *testing.T) {
|
||||
t.Fatalf("expected parallel with disallowed nested tool to fail")
|
||||
}
|
||||
}
|
||||
|
||||
func TestEnsureToolAllowedByContext_GroupAllowlist(t *testing.T) {
|
||||
ctx := withToolAllowlistContext(context.Background(), []string{"group:files_read"})
|
||||
if err := ensureToolAllowedByContext(ctx, "read_file", map[string]interface{}{}); err != nil {
|
||||
t.Fatalf("expected files_read group to allow read_file, got: %v", err)
|
||||
}
|
||||
if err := ensureToolAllowedByContext(ctx, "write_file", map[string]interface{}{}); err == nil {
|
||||
t.Fatalf("expected files_read group to block write_file")
|
||||
}
|
||||
}
|
||||
|
||||
func TestEnsureToolAllowedByContext_GroupAliasToken(t *testing.T) {
|
||||
ctx := withToolAllowlistContext(context.Background(), []string{"@pipeline"})
|
||||
if err := ensureToolAllowedByContext(ctx, "pipeline_status", map[string]interface{}{}); err != nil {
|
||||
t.Fatalf("expected @pipeline to allow pipeline_status, got: %v", err)
|
||||
}
|
||||
if err := ensureToolAllowedByContext(ctx, "memory_search", map[string]interface{}{}); err == nil {
|
||||
t.Fatalf("expected @pipeline to block memory_search")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user