Catalyzes the hydrolysis of acyl-CoAs into free fatty acids and coenzyme A (CoASH), regulating their respective intracellular levels (PubMed:16940157). Functions as a peroxisomal succinyl-coenzyme A thioesterase that can also hydrolyze glutaryl-CoA and long chain saturated acyl-CoAs (PubMed:16940157). . This is the function of ACOT4 (acyl-CoA thioesterase 4, ENSG00000177465).