fix(agentctl): allow native ACP CLIs in probe allowlist (#1059)

This commit is contained in:
Carlos Florêncio
2026-05-24 14:45:42 +01:00
committed by GitHub
parent 579081895b
commit e2483650d4
@@ -1,6 +1,35 @@
package utility
import "testing"
import (
"maps"
"path/filepath"
"slices"
"testing"
)
func TestResolveProbeCommand_AllowsEveryListedBinary(t *testing.T) {
t.Parallel()
for _, name := range slices.Sorted(maps.Keys(allowedProbeCommands)) {
t.Run(name, func(t *testing.T) {
t.Parallel()
if got := resolveProbeCommand(name); got != name {
t.Fatalf("resolveProbeCommand(%q) = %q, want %q", name, got, name)
}
path := filepath.Join("/usr/local/bin", name)
if got := resolveProbeCommand(path); got != name {
t.Fatalf("resolveProbeCommand(%q) = %q, want %q", path, got, name)
}
})
}
}
func TestResolveProbeCommand_RejectsUnknown(t *testing.T) {
t.Parallel()
if got := resolveProbeCommand("claude"); got != "" {
t.Fatalf("resolveProbeCommand(claude) = %q, want empty", got)
}
}
func TestSanitizeInferenceChunk_DropsPiVersionBanner(t *testing.T) {
t.Parallel()