buzz icon indicating copy to clipboard operation
buzz copied to clipboard

fix(desktop): repos dir setting is silently ignored on Windows

Open uevuleocha opened this issue 3 months ago • 1 comments

Summary

The Repos Directory setting in workspace settings is silently ignored on Windows. The field accepts a path, validates nothing, saves successfully, and has no effect — ~/.buzz/REPOS remains a plain in-nest directory. There is no error, no warning, and no platform note in the UI.

Environment

  • Buzz Desktop 0.5.11 (packaged OSS release), Windows 11

Reproduction

  1. Open workspace settings → Repos Directory.
  2. Enter an existing absolute path (e.g. C:\Users\you\Development). Save.
  3. Restart Buzz. Inspect ~/.buzz/REPOS.

Expected: REPOS resolves to the configured directory, so agents work in existing local checkouts — as the field's own help text promises. Actual: ~/.buzz/REPOS is an ordinary empty directory. The setting is persisted but has no effect. No feedback of any kind.

Root cause

desktop/src-tauri/src/managed_agents/repos.rs:143

#[cfg(not(unix))]
pub fn ensure_repos_symlink(nest_root: &Path, _repos_dir: Option<&str>) -> Result<(), String> {
    let repos_path = nest_root.join("REPOS");
    fs::create_dir_all(&repos_path).map_err(|e| format!("create {}: {e}", repos_path.display()))
}

The repos_dir parameter is underscore-prefixed and unused. The entire symlink implementation — plus validate_repos_dir, which would otherwise reject bad paths — is behind #[cfg(unix)] and compiled out.

Meanwhile the UI offers the field unconditionally, with no platform caveat. desktop/src/features/communities/ui/EditCommunityDialog.tsx:203

Repos Directory
<span className="ml-1 text-xs font-normal text-muted-foreground">(optional)</span>
Point the agent's <code>REPOS</code> directory at an existing
folder so agents work in your local checkouts. Leave blank to use
the default location.

The value is expanded (expandTilde) and saved through useCommunities.tsx like any other setting, so from the user's side it looks like it worked.

Impact

Windows users who point Repos Directory at their projects folder get agents cloning into ~/.buzz/REPOS instead — a second copy, disconnected from their real checkouts, with no indication why.

Suggested fix

Either would resolve the silent failure:

  • Implement it. Windows supports directory symlinks (std::os::windows::fs::symlink_dir), though it needs Developer Mode or elevation; a directory junction is an alternative that needs neither. The existing validate_repos_dir logic is platform-independent and could be lifted out of #[cfg(unix)] as-is.
  • Or surface the limitation. Hide or disable the field on Windows, or return a clear error on save, so the setting never appears to succeed while doing nothing.

Happy to hear which direction maintainers prefer before anyone writes a patch — the "implement it" path has a real decision in it (symlink vs. junction, and what to do when symlink creation is denied).

uevuleocha avatar Aug 14 '26 02:08 uevuleocha

Adding a concrete downstream consequence, now that custom ACP harnesses are a thing.

I registered Google's official agy_acp_server (from the ACP Registry) as a Custom harness. It authenticates and runs fine, but it enforces its own pre-tool directory sandbox, and its allowed roots derive from the cwd Buzz passes at session/new — which is the nest. Every tool call outside it is refused:

denied by pre-tool hook: Access to path "C:\Users\<user>\<workspace>" is denied.
It is outside the allowed workspace directories:
  [C:/Users/<user>/.buzz, .../skills, ...]

So on Windows the agent can chat and run buzz CLI commands and nothing else. With Repos Directory working, the agent's cwd would point at real checkouts and the sandbox would follow. Without it there's no supported way to move that root — the Custom harness dialog exposes Name, Command, Arguments, Env vars, Docs URL, and Install hint, but no working directory.

One caveat for the fix. The implementation I suggested in the original report — a directory symlink or junction at ~/.buzz/REPOS — would not help this class of harness. Antigravity calls realpath() before its prefix check, so a link inside the nest resolves back to the real path and is refused exactly as before. I tested this with a junction and it was denied. Harnesses that canonicalize need the real path passed as cwd, not a link standing in for it. Worth weighing if the Windows implementation goes the junction route, since it would look like it worked while leaving sandboxed harnesses broken.

Observed on Buzz Desktop 0.5.18, Windows 11, custom ACP harness antigravity (agy_acp_server_20260818_01_RC01).

uevuleocha avatar Aug 21 '26 22:08 uevuleocha