Shell Inconsistent sudo password prompt

I am seeing strange behavior since lately. I launch my first script in KDE that requires sudo password. I authenticate with sudo. Then I immediately launch my second script in the same terminal tab that also requires sudo privileges. Now, for a while that second script didn't prompt for the second sudo password, but since lately, it requires the second sudo password intermittently.

I'm so confused. This doesn't seem normal. Same scripts, no pkg upgrades, only freebsd-update for patches...
 
grep sudo /var/log/auth.log shows both attempts on the same TTY, each with a separate PWD.

My sudo password timeout is default, but it should be irrelevant because I run the second script a few seconds after the first. The timeout also works because I test it separately, and it doesn't prompt me on the second sudo request.

Google Gemini AI suggest one cause could be that the first script doesn't finish executing somehow when I run the second script. But the first script seems like it finishes because it exits and drops me back to shell. Maybe it somehow is not registered by FreeBSD as finished running?
 
Back
Top