After a restart the script looks the device up again and logs what it found, then exits 0 whatever that was. The installed log from 2026-09-21 has the case:
pnputil /restart-device ok: ... Device restarted successfully.
back as "USB Composite Device" status=Error
--- restart-esp-usb done ---
LastTaskResult was 0 and the board had no COM port. That run was the old script against a node it had itself left disabled, and #33 now enables a disabled node first, so this exact path is closed. The shape is still there for any other reason a node comes back not OK: the caller reads 0 and believes the board is reachable.
What it should do: when the same instance id is present after the restart and its status is not OK, log the Problem code and exit with a code of its own (6 is free), and have mpftp usb-restart say so. A node that is gone afterwards stays a success, because that is a board re-enumerating in download mode.
The test doubles in cli/tests/esp_usb_doubles.ps1 can play this: a scenario where the node reads Error after /restart-device.
It waits because changing the installed script costs the owner another elevated install, and nothing depends on it today.
After a restart the script looks the device up again and logs what it found, then exits 0 whatever that was. The installed log from 2026-09-21 has the case:
LastTaskResultwas 0 and the board had no COM port. That run was the old script against a node it had itself left disabled, and #33 now enables a disabled node first, so this exact path is closed. The shape is still there for any other reason a node comes back not OK: the caller reads 0 and believes the board is reachable.What it should do: when the same instance id is present after the restart and its status is not
OK, log theProblemcode and exit with a code of its own (6 is free), and havempftp usb-restartsay so. A node that is gone afterwards stays a success, because that is a board re-enumerating in download mode.The test doubles in
cli/tests/esp_usb_doubles.ps1can play this: a scenario where the node readsErrorafter/restart-device.It waits because changing the installed script costs the owner another elevated install, and nothing depends on it today.