Currently, sox_add_effect() will blindly add a requested effect to chain for user. Its probably going to be updated shortly to not be so blind.
Its possible to detect when requested inserted effect requires to output # channels or sample rate thats different then the previous effect is outputing and doesn't have a flag set that it can handle converting itself.. This should return an error when detected. The proper response would be to first insert a resample or mixer effect that can handle the conversion.
I think a good chunk of people don't really want to have to worry about this case. For example, they may want to use libsox to do file conversion and not really for the effects engine.
This is roughly what the src/exampl1.c distributed with sox shows. But if you run it as "example1 infile.wav outfile.cdr", it will create an invalid file unless the input file is already 44100 rate.
I think people would find a version of sox_add_effect_with_autio() that auto-inserts a rate or mixer effect as needed would be appreciated. This should be in addition to current sox_add_effect() because there may be some power effects users that want to handle this themselves.