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_cpu tool.
- Try setting
throttlingRate = 0 or 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.
Description:
The
emulate_cputool located insrc/tools/emulation.tsdoes not currently support disabling CPU emulation once it has been enabled. ThethrottlingRateparameter enforces a minimum value of1, which applies the lowest level of throttling but does not fully disable the emulation. This behavior is inconsistent with theemulate_networktool, which allows network emulation to be completely turned off.The underlying Puppeteer API (
page.emulateCPUThrottling) expects a value ofnullor0to disable CPU throttling, which is not supported by the current implementation.To Reproduce:
emulate_cputool.throttlingRate = 0or attempt to disable the feature.emulate_network, which allows disabling.Expected Behavior:
Setting
throttlingRateto0ornullshould fully disable CPU emulation, in line with howemulate_networkbehaves. The tool should allow disabling the feature entirely without requiring a full reload.