You’re right. They have no army. And Nicaragua in the North is always in a bad mood when it comes to CR. The Nicas come across the border to work and the Ticos treat them as illegals. But Panama in the south is very friendly. And well armed with American weapons. Plus we land Marines in the ports of CR from time to time for drug interdiction. And the terrain is similar to Switzerland - not easily overrun. And there isn’t much for an invading army to steal....mostly farm lands and crops. I wouldn’t worry about that.
As far as south, I’d regard Panama as a likely target of hostile intent, likely at the hands of Venezuela and to some extent Cuba. The international mercantilist economy would be heavily impacted, putting it into shambles for years between loss of demand, lack of accepted means of exchange and trade barriers, so China would be rather preoccupied in their more immediate sphere. Closer neighbors would have much to fear, but far flung I suspect not.