[macos] Accessibility permission prompt reappears every ~10s even after granting access

Open Beginner friendly
#147 0 comments 0 reactions 0 assignees View on GitHub

@StreamOfRon is already working on this.

Since Sep 27, 2026.

  • #148 by @StreamOfRon — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python, swift

Research direction

Start in aw_watcher_window/macos.swift, reading checkAccess() and the start() retry block to trace when prompts and polling occur. Check macos_permissions.py only to keep its separate one-shot dialog in scope. Done means the helper prompts at most once per launch, then polls silently so a permission granted in System Settings takes effect without restart.

Written by the indexing model from the issue text.

Description

Describe the bug

On macOS, the system Accessibility permission prompt ("ActivityWatch" would like to control this Mac / "Device control and data access" on macOS 26+) reappears roughly every 10 seconds while ActivityWatch is running, even though access has already been granted in System Settings.

Environment

  • OS: macOS 27.0 (also applies to earlier versions; on macOS 26+ the setting is named "Device control and data access")
  • ActivityWatch version: 0.14.0b9 (locally built .app, adhoc-signed, copied to /Applications)
  • Watcher strategy: swift (default on macOS)

Root cause

The process requesting access is not the top-level ActivityWatch.app — it is the nested helper aw-watcher-window-macos (a different code identity / cdhash). Granting "ActivityWatch" in Settings therefore does not satisfy the helper, and the helper stays untrusted.

Worse, the helper re-prompts on every retry: checkAccess() in aw_watcher_window/macos.swift calls AXIsProcessTrustedWithOptions with kAXTrustedCheckOptionPrompt=true, and start() retries checkAccess() every 10s on failure — so an untrusted helper prompts forever at 10s intervals. The prompt is labeled with the bundle name ("ActivityWatch"), which makes it look like the grant did not stick.

Adhoc-signed / locally built bundles make this more likely (any rebuild rotates the cdhash and invalidates prior grants), but the prompt loop affects any setup where the helper itself is not the granted identity.

Expected behavior

Prompt at most once per helper launch; afterwards poll silently so a grant made in Settings takes effect without restart (and without nagging).

Notes

  • The Python wrapper's own dialog (macos_permissions.py, "Missing accessibility permissions") is a separate, one-shot alert and is not the source of the loop.
  • Related code: aw_watcher_window/macos.swift checkAccess() and the start() retry block.
Dominant language
Python
Stars
133
Forks
92
Avg merge
5d 3h
Merged PRs (30d)
4

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ActivityWatch/aw-watcher-window

All issues in ActivityWatch/aw-watcher-window

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.