If I'm not mistaken, they sent supplies like ammo and weapons, but why didn't they commit troops?
First of all, they did commit troops, they were in advisory, anti-aircraft and technical roles rather than front line combat units. Thousands of them were killed during the war. It's estimated that a total of 150,000 Chinese anti-aircraft personnel were engaged in the war (not all at once however, they were rotated in and out of the country). China claims that they shot down over 1,000 US aircraft over North Vietnamese airspace.
Second of all it should be noted that the amount of supplies that the Chinese sent were very, very significant, the total amount of aid rendered to the North Vietnamese in terms of materials exceeded that which was transferred to the North Koreans during the Korea War.
At the same time the Chinese leadership did commit themselves to introduce combat troops directly into Vietnam if the US invades the North directly. The direct precedence for this is the Korean war, in which China refrained from intervention until the UN crossed the 38th parallel. But China did not want to confront the US directly for the sake of unifying Vietnam under Communist rule.