And then there's the broader issue of "cosmopolitan Tang."
People say the Tang were exceptionally cosmopolitan and friendly to barbarians, and this is (a.) true to some extent at certain times, and (b.) pretty overblown, especially when put in context of other empires who did the same stuff, but which we don't describe as such. For example, the Tang employed barbarians as foederati. They put them on the borders, gave them military posts, tried to Sinicize them, and occasionally saw them rebel... just like Rome did, and we don't talk about how barbarophilic Rome was, do we?
They also tolerated foreign religions... up until they
didn't, at which point they repressed them so brutally that all of them except Buddhism disappeared from China. They had large foreign populations at the capital... which faced mounting discrimination over time and were often forced to distinguish themselves in dress from Han people explicitly in order to avoid intermixing. I recall a medieval practice involving Jews and yellow stars.
They liked exotic foreign styles... and the French had chinoiserie, and the Qing did the same for western stuff: observe this
painting of the Yongzheng emperor cosplaying as a European. Japan in the Sakoku era had a whole field of called
Rangaku or "Dutch studies"... and yet I distinctly recall something about them being militant isolationists. By this logic, 17th and 18th century Japan's
love for European gadgets is a sign of their profound cosmopolitanism.
I don't know for certain, but I'm pretty sure that this is the result of one particular modern historian looking at modern China, hating it, and trying to find its opposite somewhere in the past. And they landed on the Tang. The result that this historian then came up with just sounds like that sort of weird idiosyncrasy that sounds cool and unexpected to the casual history reader but also jibes with a lot of modern people's wishful thinking, so it spreads like wildfire.