Files
multica/server/pkg/agent/mcp_config.go
2026-07-12 02:53:17 +08:00

15 lines
440 B
Go

package agent
import (
"bytes"
"encoding/json"
)
// hasManagedMcpConfig preserves the API's three-state MCP semantics. Only SQL
// NULL / JSON null mean "inherit the runtime configuration"; any object,
// including an explicitly empty one, is a managed set and enables strict mode.
func hasManagedMcpConfig(raw json.RawMessage) bool {
trimmed := bytes.TrimSpace(raw)
return len(trimmed) > 0 && !bytes.Equal(trimmed, []byte("null"))
}