This microtask vs macrotask priority is something I ran into the hard way building an async agent orchestration system on Node.js. I had a chain of Promise.resolve() callbacks coordinating sub-processes, and a setTimeout(0) health check that kept getting starved because the microtask queue never fully drained between cycles.
Ended up refactoring the health checks to use setImmediate() on the I/O callback phase instead, which gave them a more predictable slot in the loop.
One thing I am curious about — have you noticed any practical difference in how queueMicrotask() behaves vs Promise.resolve().then() in terms of ordering? In theory they both hit the microtask queue, but I have seen some edge cases with nested microtasks where the scheduling felt slightly different.