fix(core): bind splitText when trimMessages receives a TextSplitter instance (#11153)