Correct promise resolution for emit-to command

That was blocking calls and timing out on the calling agent.