Just long enough!!
That depends on the wire size and how much it will compress, too thick and it will compress solid and won't release the barrel, cut shorter it won't have enough travel. There's only so much room to allow for a stronger spring, those listed in the FAQs from McMaster-Carr are .041" wire, .250" in diameter and work excellent, and you'll get more than you need for less than $15, a lot less than $15 from those that have reported the shipping being charged, or mischarged! I cut them to about .550" (IIRC
) then trim until the latch will just release the barrel, which takes some trial and error knocking the pins out to get the barrel off!!
Tim