agent: Handle cancel for idle wait
command/exec: Tuning constants