Hi, New user here, so maybe I'm talking BS.
I'm wondering if getting rid of sudo for reconfiguration is an option. What if instead of running all the process as root, it invoked sudo (or doas) in the final stage, so it can perform the bits that require permissions? That way, it would use the user channel directly and this issue would not exist. Regards, Jorge