Skip to content

fix(app): test fix for permission spam - add beta for testing purposes pls#15240

Open
neriousy wants to merge 1 commit intoanomalyco:devfrom
neriousy:fix/test-fix-for-permission-spam
Open

fix(app): test fix for permission spam - add beta for testing purposes pls#15240
neriousy wants to merge 1 commit intoanomalyco:devfrom
neriousy:fix/test-fix-for-permission-spam

Conversation

@neriousy
Copy link
Contributor

Issue for this PR

Closes #15090 #14982

Type of change

makes the working directory to home instead of /
file watcher ignores scanning for system root

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

thesis: file watcher triggers permissions

If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!

How did you verify your code works?

"for me it happens when i open apps like the music app
the permission comes up" - try doing that

Screenshots / recordings

If this is a UI change, please include a screenshot or recording.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

not on mac, can you add beta tag

If you do not follow this template your PR will be automatically rejected.

Copilot AI review requested due to automatic review settings February 26, 2026 15:37
@neriousy neriousy changed the title fix: test fix for permission spam fix(app): test fix for permission spam Feb 26, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses macOS permission prompt spam by avoiding filesystem watching/indexing behaviors that can inadvertently traverse sensitive directories when the app starts with an unsafe working directory.

Changes:

  • Skip initializing the Parcel file watcher when Instance.directory is the filesystem root.
  • Set the desktop sidecar process working directory to the user’s home directory (when available).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/opencode/src/file/watcher.ts Avoids subscribing a watcher on the filesystem root to prevent broad scanning/permission prompts.
packages/desktop/src-tauri/src/cli.rs Sets sidecar current working directory to HOME/USERPROFILE to avoid starting in /.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +332 to +335
let home = std::env::var_os("HOME").or_else(|| std::env::var_os("USERPROFILE"));
if let Some(home) = home {
cmd.current_dir(home);
}
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

Using HOME/USERPROFILE env vars can be unset (or even empty) in some launch contexts (notably GUI apps), which would silently leave the process working directory unchanged and undermine the goal of avoiding / as the CWD. This crate already depends on dirs and uses dirs::home_dir() elsewhere; consider switching to dirs::home_dir() (and/or filtering out empty values) and only calling current_dir when the resolved path exists/is a directory.

Copilot uses AI. Check for mistakes.
@neriousy neriousy changed the title fix(app): test fix for permission spam fix(app): test fix for permission spam - add beta for testing purposes pls Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Permission request spam

3 participants