fix(app): test fix for permission spam - add beta for testing purposes pls#15240
fix(app): test fix for permission spam - add beta for testing purposes pls#15240neriousy wants to merge 1 commit intoanomalyco:devfrom
Conversation
There was a problem hiding this comment.
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.directoryis 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.
| let home = std::env::var_os("HOME").or_else(|| std::env::var_os("USERPROFILE")); | ||
| if let Some(home) = home { | ||
| cmd.current_dir(home); | ||
| } |
There was a problem hiding this comment.
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.
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
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
not on mac, can you add beta tag
If you do not follow this template your PR will be automatically rejected.