Skip to content

GlobTool cannot find files on Windows if cwd has lower drive letter #668

@RoboBurned

Description

@RoboBurned

What happened?

When starting qwen on Windows from the command prompt where current directory is like "c:\code" with a lower "c:" drive and asking a prompt like "Find all csproj files" there are no files found because they all are ignored.

╭───────────────────────────╮
│  > Find all csproj files  │
╰───────────────────────────╯

✦ I'll help you find all .csproj files in the current directory and its subdirectories.


 ╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
 │ ✓  FindFiles '**/*.csproj'                                                                       │
 │                                                                                                  │
 │    No files found                                                                                │
 ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ I've searched for all .csproj files in the current directory and its subdirectories, but it seems there
  are no .csproj files found. The only file with a .csproj extension that was mentioned in the folder
  structure is "1.csproj" at the root level, but it appears to be ignored by git.

If I change directory to "C:\code" and start qwen again then files can be found.

What did you expect to happen?

I expect the search to ignore file case when searching files on Windows.

Client information

Client Information

Run qwen to enter the interactive CLI, then run the /about command.

$ qwen /about

╭──────────────────────────────────────────────────────╮
│                                                      │
│ About Qwen Code                                      │
│                                                      │
│ CLI Version       0.0.12                             │
│ Git Commit        3579d655                           │
│ Model             qwen3-coder-plus                   │
│ Sandbox           no sandbox                         │
│ OS                win32                              │
│ Auth Method       qwen-oauth                         │
│                                                      │
╰──────────────────────────────────────────────────────╯

Login information

No response

Anything else we need to know?

Investigating the problem I found the issue around https://github.com/QwenLM/qwen-code/blob/3579d6555ad48d1d9152a38b45ebfb47dd8b4ed4/packages/core/src/tools/glob.ts#L147C15-L147C23

The entries array returned by glob library has the result, but with upper drive letter like "C:\code\1.csproj".
All other variables getTargetDir, relativePaths, filteredAbsolutePaths contains paths with a smal drive letter.

The result is that filteredEntries does not contain any items because search in a Set is performed case-sensitive.

I see two problems here:
1 glob returns items with another casing than specified in searchDir
2 Filtering is performed case sensitive even if params.case_sensitive is false.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/P1High priority issuetype/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions