agent: refactor to use taskChain