KIm sh*ts on human rights and still China don't has an agreement with the United States to stop him, because it's almost or maybe always never about human rights.
There is also the fact that a war with North Korea would be incredibly consuming for the United States. I remember reading somewhere that the Pentagon reckon they would need at least 200,000 troops for a war with North Korea to ensure victory.
Add to that, that it is generally accepted that North Korea would retaliate by launching nuclear missiles on Seoul, which would be a devasting number in human loses. Indeed, this fear is basically what keeps the United States at the DMZ.
And that's just the war part. Then there is maintaining the peace. The South Korean Ministry of Reunification has a detailed list of all potential problems they would have to deal with in a reunification scenario.
That means that China views the role of North Korea as a buffer between China and South Korea (with US military presence) as very important.
It's a nice buffer sure, and China prefers not bothering an actual US ally. But it's not that important
and moreover, China isn't really benefitting from North Korea as much anymore as they used to.
Indeed, China is not the reason the US has not declared war on North Korea. North Korea is.
So why would China in the case of an American invasion (I know that won't happen as long as North Korea doesn't attack the south, which will also not happen) not protect the buffer (North Korea) with military force?
Beyond the fact that it would never happen, it would not be in China's interest. China benefits hugely from overly peaceful relations with the United States, compared to be direct enemies at war. North Korea is not that important. More to the point, in the case of an American invasion, something significant must have been triggered that most likely would cause China and the US to join forces.
Why would they allow that after an invasion Americn troops would be stationed near the Chinese borders?!
Again, they would just have to accept that unless they want to see everyone's downfall.
Remember, that everyone involved in this prefers the status quo, because it is at the very least predictable. A potential war with North Korea and what follows is so unpredictable that it might be a world war the likes of which we've never seen. Human rights be damned, that's simply not worth the risk.
Of course the world's powers try eveything to expand their power and weaken the other world powers directly or indirectly, as long as it doesn't cause a war between the world's powers. But there are limits. And any military intervention against North Korea is beyond that limit. China knows exactly what happened after our own unification (NATO east expansion), which was an historical luck for us. As for Korea the consequences are even more simple to foresee (American military base(s) in North Korea. So as long as the North Korean dictatorship can maintain power and does nothing more than threatening others, the situation in Korea will never change. I know it is unjust but justice obviously doesn't count much in international politics.
I know I too like fighting the good fight, but I don't really see it necessary to potentially ruin the lives of millions more people than the people that actually live in North Korea. No matter which way you bend it, war is not the answer in this case.