As long as I can remember, the generators have never supported asynchronous code. Generator functions for statement blocks are expected to return strings and generator functions for value blocks are expected to return a tuple (array) containing the code and the ordering value. By returning a promise (via the use of async) rather than a string/array the function is violating that contract. A bunch of the internals of generators would need to be updated to support this. However, is there a particular reason why the API call has to happen at the point of code generation? If you know that it has to happen sooner, you could run it before the code generation step occurs. If it's in response to user-provided blocks, then you could have your emitted code include the API call. Can you elaborate on the specific use case?
Regards,