diff --git a/cmd/picoclaw/internal/agent/command_test.go b/cmd/picoclaw/internal/agent/command_test.go index 1457d6a49..18a888ec6 100644 --- a/cmd/picoclaw/internal/agent/command_test.go +++ b/cmd/picoclaw/internal/agent/command_test.go @@ -16,7 +16,7 @@ func TestNewAgentCommand(t *testing.T) { assert.Equal(t, "Interact with the agent directly", cmd.Short) assert.Len(t, cmd.Aliases, 0) - assert.False(t, cmd.HasSubCommands()) + assert.True(t, cmd.HasSubCommands()) assert.Nil(t, cmd.Run) assert.NotNil(t, cmd.RunE) diff --git a/pkg/routing/route.go b/pkg/routing/route.go index c5a273e92..1592efd92 100644 --- a/pkg/routing/route.go +++ b/pkg/routing/route.go @@ -121,8 +121,8 @@ func (r *RouteResolver) ResolveRoute(input RouteInput) ResolvedRoute { func (r *RouteResolver) filterBindings(channel, accountID string) []config.AgentBinding { var filtered []config.AgentBinding for _, b := range r.cfg.Bindings { - matchChannel := strings.ToLower(strings.TrimSpace(b.Match.Channel)) - if matchChannel == "" || matchChannel != channel { + matchChannel := strings.TrimSpace(b.Match.Channel) + if matchChannel == "" || !strings.EqualFold(matchChannel, channel) { continue } if !matchesAccountID(b.Match.AccountID, accountID) { @@ -141,7 +141,7 @@ func matchesAccountID(matchAccountID, actual string) bool { if trimmed == "*" { return true } - return strings.ToLower(trimmed) == strings.ToLower(actual) + return strings.EqualFold(trimmed, actual) } func (r *RouteResolver) findPeerMatch(bindings []config.AgentBinding, peer *RoutePeer) *config.AgentBinding { @@ -150,12 +150,12 @@ func (r *RouteResolver) findPeerMatch(bindings []config.AgentBinding, peer *Rout if b.Match.Peer == nil { continue } - peerKind := strings.ToLower(strings.TrimSpace(b.Match.Peer.Kind)) + peerKind := strings.TrimSpace(b.Match.Peer.Kind) peerID := strings.TrimSpace(b.Match.Peer.ID) if peerKind == "" || peerID == "" { continue } - if peerKind == strings.ToLower(peer.Kind) && peerID == peer.ID { + if strings.EqualFold(peerKind, peer.Kind) && peerID == peer.ID { return b } }