Skip to content

[GUI] find_daemon_binary walks entire directory tree without depth limit #64

@Vantalens

Description

@Vantalens

File: packages/gui/src-tauri/src/lib.rs:184

Severity: Low

Description:
If cwd is deep in filesystem (e.g., /home/user/projects/a/b/c/d/e/f), traverses dozens of directories checking each for codepanion-rust/target/*/; slow startup on slow disks or network mounts.

Code:

let mut dir = env::current_dir().ok();
while let Some(current) = dir {
    // check for daemon binary
    dir = current.parent().map(Path::to_path_buf);
}

Failure Scenario:

  • GUI launched from deeply nested project directory
  • Searches parent → grandparent → ... → filesystem root
  • On Windows with network drives or slow HDD: 5-10 second startup delay
  • User experiences 'Starting CodePanion...' freeze

Suggested Fix:
Limit traversal to 10 levels or check for git root as boundary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingguiGUI/frontend related issuesrustRust code related issues

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions