Skip to content

detect_changes fails on Windows paths with spaces ("project path contains invalid characters") #137

Closed

Description

@shekthesnek

Bug Report

Tool: detect_changes
Version: v0.5.6 (released 2026-03-23)
Platform: Windows 11 Home (amd64)

Description

The detect_changes tool fails with "project path contains invalid characters" when the project path contains spaces. All other tools work correctly with the same path.

Reproduction

Project path: C:\Users\abish\OneDrive - PomeGran Inc\Files\kpi-dashboard

This path contains spaces due to the OneDrive folder name. Calling detect_changes with this path produces the error immediately. No other tool is affected.

Working tools (same path, no issues):

  • search_graph
  • trace_call_path
  • query_graph
  • get_code_snippet
  • index_repository
  • ...and 7 other tools (12 total work fine)

Failing tool:

  • detect_changes — returns "project path contains invalid characters"

Expected Behavior

detect_changes should handle paths containing spaces, consistent with the other 12 tools that already work correctly.

Likely Root Cause

detect_changes probably shells out to git diff (or similar) without properly quoting the path argument. When the path contains spaces, the unquoted string is split by the shell and rejected.

Related Issues

This appears to be the same class of bug as #80 and #121 (Windows path handling), which were previously fixed for other tools but missed for detect_changes.

Activity

  1. DeusData commented on Mar 24, 2026

    @DeusData
    Owner

    Fixed — detect_changes now uses git -C instead of cd + shell quoting.

    Root cause: cd '%s' with single quotes works on POSIX but fails on Windows (cmd.exe doesn't understand single quotes). Paths with spaces caused the shell to split arguments.

    Fix: replaced with git -C "<path>" which handles spaces correctly on both platforms. Windows gets double-quoted paths, POSIX keeps single-quoted with -C for consistency.

  2. DeusData commented on Mar 24, 2026

    @DeusData
    Owner

    Thanks @shekthesnek for the clear reproduction steps and the note about the 12 working tools vs 1 failing — that narrowed the root cause immediately.

  3. added a commit that references this issue on Mar 24, 2026
  4. added 2 commits that reference this issue on Apr 8, 2026
  5. added a commit that references this issue on May 20, 2026
  6. added a commit that references this issue on May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions