fix(uik): stop an unattended Mac claiming the user is sitting at it - #67
Conversation
Petrus: "Why user intent has one box at the top saying i work on mac mini? I am on s26 ultra codewatch atm". `screen_active` was hardcoded true. The derived state picks the most recently updated device whose screen is active as the one the user is on, and this daemon republishes every 30 seconds — so an unattended Mac won that contest permanently. The Mini had not been touched for 18 hours (HIDIdleTime read 64,570s) and was still announcing itself as where Petrus was working. It now reports real idle time from the HID system: active under five minutes, idle beyond it, with `idle_sec` published so a card can say how long. The frontmost application only sets "coding" or "meeting" when someone is actually there — an editor in the foreground on a machine nobody has touched since yesterday is not coding. Where the OS will not report idle time the field stays true, as before, rather than guessing a user away. This is necessary but not sufficient for what Petrus saw: @grok measured that no S26 device publishes to UIK at all, so the phone cannot be chosen as the preferred device even once the Macs stop lying. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d8b1ab6af4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Infer context from active app — but only when someone is actually | ||
| // at the machine. A frontmost editor on a box nobody has touched since | ||
| // yesterday is not "coding". | ||
| if (state.screen_active) { |
There was a problem hiding this comment.
Preserve meeting context during input-idle periods
During a Zoom, Teams, FaceTime, or Webex call where the user listens for five minutes without touching the keyboard or mouse, screen_active becomes false and this guard suppresses the existing meeting inference. The adapter then publishes context: "idle", so derived intent can stop applying meeting-specific text-only/audio-suppression behavior even though the call remains foreground. HID idle measures input inactivity rather than call participation; meeting applications should be detected before this gate or exempted from it.
Useful? React with 👍 / 👎.
Petrus: "Why user intent has one box at the top saying i work on mac mini? I am on s26 ultra codewatch atm"
screen_activewas hardcodedtrue. The derived state picks the most recently updated device whose screen is active as the one the user is on, and this daemon republishes every 30 seconds — so an unattended Mac won that contest permanently.Measured on the Mini while Petrus was on his phone:
Now it reads the real idle time: active under five minutes, idle beyond, and publishes
idle_secso a card can show how long. The frontmost app only setscoding/meetingwhen someone is actually present — an editor in the foreground on a machine nobody has touched since yesterday is not coding.After the change, same machine:
screen_active: false, context: "idle", idle_sec: 64613.Where the OS will not report idle time, the field stays
trueas before rather than guessing the user away.Necessary but not sufficient. @grok measured that no S26 device publishes to UIK at all — live devices are macbook, mac-mini and vadelma, with clawwatch stale. So the phone still cannot be chosen as preferred once the Macs stop lying; that half is the CodeWatch client publishing device presence.
Co-Authored-By: Claude Opus 5 noreply@anthropic.com