From 04a6e432f5cef221d36d74dd323065143b1b4df8 Mon Sep 17 00:00:00 2001 From: neriousy Date: Thu, 26 Feb 2026 16:35:22 +0100 Subject: [PATCH] fix: test fix for permission spam --- packages/desktop/src-tauri/src/cli.rs | 5 +++++ packages/opencode/src/file/watcher.ts | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/packages/desktop/src-tauri/src/cli.rs b/packages/desktop/src-tauri/src/cli.rs index af1a45cf3a3..c46e54bb454 100644 --- a/packages/desktop/src-tauri/src/cli.rs +++ b/packages/desktop/src-tauri/src/cli.rs @@ -329,6 +329,11 @@ pub fn spawn_command( cmd }; + let home = std::env::var_os("HOME").or_else(|| std::env::var_os("USERPROFILE")); + if let Some(home) = home { + cmd.current_dir(home); + } + cmd.stdout(Stdio::piped()); cmd.stderr(Stdio::piped()); cmd.stdin(Stdio::null()); diff --git a/packages/opencode/src/file/watcher.ts b/packages/opencode/src/file/watcher.ts index 626a746c832..6bacbaed10b 100644 --- a/packages/opencode/src/file/watcher.ts +++ b/packages/opencode/src/file/watcher.ts @@ -74,6 +74,11 @@ export namespace FileWatcher { const subs: ParcelWatcher.AsyncSubscription[] = [] const cfgIgnores = cfg.watcher?.ignore ?? [] + if (Instance.directory === path.parse(Instance.directory).root) { + log.warn("skipping watcher for filesystem root", { directory: Instance.directory }) + return { subs } + } + if (Flag.OPENCODE_EXPERIMENTAL_FILEWATCHER) { const pending = w.subscribe(Instance.directory, subscribe, { ignore: [...FileIgnore.PATTERNS, ...cfgIgnores],