Cannot Disable CPU Emulation in `emulate_cpu` Tool
Description:
The emulate_cpu tool located in src/tools/emulation.ts does not currently support disabling CPU emulation once it has been enabled. The throttlingRate parameter enforces a minimum value of 1, which applies the lowest level of throttling but does not fully disable the emulation. This behavior is inconsistent with the emulate_network tool, which allows network emulation to be completely turned off.
The underlying Puppeteer API (page.emulateCPUThrottling) expects a value of null or 0 to disable CPU throttling, which is not supported by the current implementation.
To Reproduce:
- Enable CPU emulation using the
emulate_cputool. - Try setting
throttlingRate = 0or attempt to disable the feature. - Observe that throttling remains active at the minimum level instead of turning off.
- Compare this behavior with
emulate_network, which allows disabling.
Expected Behavior:
Setting throttlingRate to 0 or null should fully disable CPU emulation, in line with how emulate_network behaves. The tool should allow disabling the feature entirely without requiring a full reload.
If you guys assign this issue to me I can work on fixing this issue
Hello,
The current underlying implementation is working as expected and 1 is also a correct value for resetting the CPU emulation.
Given that I will mark this issue as close, but feel free to leave more comments here and I will follow up.
Was there an issue with using that tool that you observed?