Skip to content

fix(permissions): probe Input Monitoring once per process, not every 15s (#488)#500

Merged
silverstein merged 1 commit into
mainfrom
fix/input-monitoring-probe-once
Jul 17, 2026
Merged

fix(permissions): probe Input Monitoring once per process, not every 15s (#488)#500
silverstein merged 1 commit into
mainfrom
fix/input-monitoring-probe-once

Conversation

@silverstein

Copy link
Copy Markdown
Owner

Follow-up to #499. The CFMachPortInvalidate teardown fix stopped the tap leak; this stops the churn that fed it.

What

input_monitoring_runtime_issue() created and tore down a real kCGHIDEventTap on every 15s permission-monitor poll (for users who granted Input Monitoring) to detect a "granted but unusable" state. That state is fixed for the process lifetime — it's only cleared by restarting the app — so re-probing is pointless churn on the system-wide input event path (~5,760 tap create/teardown cycles/day). Before #499's teardown fix, this churn is what leaked taps until the 512-entry table exhausted and keyboard/mouse froze system-wide (with WindowServer crashes).

Memoize the probe (OnceLock) so it runs once per launch, preserving the diagnostic with zero ongoing churn.

Why this matters

This is the long-standing "Minutes left open overnight makes the whole machine laggy/frozen; quitting Minutes instantly fixes it; SSH stays fine" report — the taps are on kCGHIDEventTap, the system-wide HID path. #499 + this fix together fully resolve it.

Related: #488, #499.

🤖 Generated with Claude Code

…15s (#488)

input_monitoring_runtime_issue() created and tore down a real
kCGHIDEventTap on every 15s permission-monitor poll (for users who granted
Input Monitoring) just to detect a "granted but unusable" state. That state
is fixed for the process lifetime -- it's only cleared by restarting the
app -- so re-probing is pointless churn on the system-wide input event
path. Before #488's teardown fix this churn leaked taps until the tap table
exhausted and keyboard/mouse froze system-wide (WindowServer could crash).

Memoize the probe result so it runs exactly once per launch, preserving the
diagnostic with zero ongoing churn. Complements the CFMachPortInvalidate
teardown fix (#499).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
useminutes.app Ready Ready Preview, Comment Jul 17, 2026 3:44pm

@silverstein
silverstein merged commit e393121 into main Jul 17, 2026
24 checks passed
silverstein added a commit that referenced this pull request Jul 17, 2026
Patch release. Bugfixes only.

- fix(hotkey): stop the system-wide CGEventTap leak — a permission probe
  created a kCGHIDEventTap every 15s and never invalidated it, exhausting
  the system tap table and freezing keyboard/mouse (and crashing
  WindowServer) after the app ran a few hours; quitting Minutes restored
  performance. Now invalidated on teardown and probed once per process.
  (#488, #499, #500)
- fix(build): pin the Swift helper deployment targets so 0.22.0's
  native-call-capture helper loads on macOS 15 instead of dyld-aborting.
  (#494, #497)
- fix(core): let `--call` auto-detect PipeWire system-audio sinks on Linux.
  (#489, thanks @gtheys)
- fix(summarize): support the Apple engine for speaker mapping. (#487, #498)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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