refactor(agent): source discovery identity from AGENT.md frontmatter

This commit is contained in:
afjcjsbx
2026-03-29 22:43:20 +02:00
parent bca131909d
commit 6429f6af9a
13 changed files with 281 additions and 160 deletions
+2 -2
View File
@@ -51,7 +51,7 @@ func (r *ToolRegistry) SetAllowlist(names []string) {
allowlist := make(map[string]struct{}, len(names))
for _, name := range names {
trimmed := strings.TrimSpace(name)
trimmed := strings.ToLower(strings.TrimSpace(name))
if trimmed == "" {
continue
}
@@ -172,7 +172,7 @@ func (r *ToolRegistry) toolAllowedLocked(name string) bool {
if r.allowlist == nil {
return true
}
_, ok := r.allowlist[name]
_, ok := r.allowlist[strings.ToLower(strings.TrimSpace(name))]
return ok
}
+1 -1
View File
@@ -101,7 +101,7 @@ func TestToolRegistry_RegisterAndGet(t *testing.T) {
func TestToolRegistry_AllowlistFiltersRegistrations(t *testing.T) {
r := NewToolRegistry()
r.SetAllowlist([]string{"allowed_tool"})
r.SetAllowlist([]string{"Allowed_Tool"})
r.Register(newMockTool("allowed_tool", "allowed"))
r.Register(newMockTool("blocked_tool", "blocked"))