feat: ship subagent runtime and remove autonomy/task legacy

This commit is contained in:
lpf
2026-03-05 21:54:54 +08:00
parent 29d6480058
commit e8e1cdae32
32 changed files with 1844 additions and 2867 deletions

View File

@@ -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")
}
}