Skip to content

fix(uik): stop an unattended Mac claiming the user is sitting at it - #67

Merged
ThinkOffApp merged 1 commit into
mainfrom
fix/honest-screen-active
Aug 17, 2026
Merged

fix(uik): stop an unattended Mac claiming the user is sitting at it#67
ThinkOffApp merged 1 commit into
mainfrom
fix/honest-screen-active

Conversation

@ThinkOffApp

Copy link
Copy Markdown
Owner

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.

Measured on the Mini while Petrus was on his phone:

HIDIdleTime = 64,570s  ≈ 17.9 hours untouched
published:   screen_active: true, context: "coding"

Now it reads the real idle time: active under five minutes, idle beyond, and publishes idle_sec so a card can show how long. The frontmost app only sets coding/meeting when 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 true as 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

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>
@cursor

cursor Bot commented Aug 17, 2026

Copy link
Copy Markdown

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@ThinkOffApp
ThinkOffApp merged commit 3c17ae3 into main Aug 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant