Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

[bug] Location pickDevice treats a locked Mac as the one in use

Open IvanLeontev-stack opened this issue 3 weeks ago • 1 comments

What happened

Location pickDevice treats a locked Mac as the one in use. The local idle timer can read near zero while the screen is locked, because input that is not the person's resets it. On a two-Mac setup a locked desktop then wins over a laptop the person is actively typing on.

Summary

pickDevice in LIFEOS/LOCATION/Location.ts returns this-mac as soon as the local idle time is under ACTIVE_IDLE_MIN, before it looks at any other device.

On a desktop Mac the idle timer can read 0 seconds while the screen is locked, because input that does not come from the person resets it. Observed on 8.761.0: a locked Mac read 0 s idle every second while the person was typing on a MacBook, so Location.ts devices named the wrong machine and everything reading it opened on the desk nobody was at.

Suggested fix, running here as a local patch: treat a locked screen as not at this Mac (CGSSessionScreenIsLocked from ioreg -n Root -d1), and let another Mac with input in the last two minutes outrank the local timer. The change is about ten lines inside pickDevice plus one helper, and pickDevice takes the lock state as an optional field so it stays testable.

Details

  • Kind: bug
  • LifeOS version: 8.761.0

Filed with the LifeOS /feedback command. The reporter approved this exact text before it was sent; paths, secrets and personal details were stripped locally.

IvanLeontev-stack avatar Nov 09 '26 10:11 IvanLeontev-stack

[!NOTE] 🤖 Kai (AI assistant) responding on behalf of Daniel Miessler

A locked Mac could count as the one in use, because input that did not come from a person kept resetting its idle timer to zero. pickDevice now reads the console lock state from ioreg, and a locked Mac never wins. The freshest unlocked Seat Mac with recent input wins instead, and the same check gates the at-desk paths. I added tests for the locked case and for parsing the lock flag. Your second suggestion, letting another Mac with recent input outrank an unlocked local idle timer, is not built yet.

This fix lands in the next LifeOS release, so I'm closing this now.

danielmiessler avatar Nov 20 '26 02:11 danielmiessler