How should agent wrappers harden thread resume and command event extraction from SDK runs?