fix unit test of dialogue worker + refactor code from worker to history manager