google-gemini / google-gemini/gemini-cli
VS Code + WSL: Gemini writes files to the wrong project/workspace
- Dominant language
- TypeScript
- Stars
- 107k
- Forks
- 14.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 45
Description
### What happened?
I am using Gemini in VS Code with WSL.
While working in:
/home/jacques/repogit/mmm-tools/FLUX
I asked Gemini to create:
tests/gemini_test_repo_parent.txt
Gemini reported success and showed the relative path inside the active project, but the file was actually created in a different repository:
/home/jacques/repogit/data-model-core/mmm/tests/gemini_test_repo_parent.txt
So the displayed path did not match the real write location.
Steps to reproduce:
1. Open VS Code in WSL.
2. Work in a project such as /home/jacques/repogit/mmm-tools/FLUX.
3. Ask Gemini to create a file in tests using a relative path.
4. Gemini reports success.
5. Search the filesystem and verify the file may be created in a different repository.
### What did you expect to happen?
The file should have been created in the active workspace, at:
/home/jacques/repogit/mmm-tools/FLUX/tests/gemini_test_repo_parent.txt
Gemini should always resolve relative paths against the current workspace/project only.
The path displayed in the UI should match the actual file written on disk.
### Client information
Using Gemini in VS Code with WSL Ubuntu.
This report comes from the VS Code integration, not Gemini CLI.
Platform: Windows + WSL Ubuntu.
### Login information
google account
### Anything else we need to know?
How can we reproduce it?
1. Open VS Code in WSL.
2. Open or work inside a project such as:
/home/jacques/repogit/mmm-tools/FLUX
3. Ask Gemini to create a file with a relative path, for example:
"Create a test file named gemini_test_repo_parent.txt in the tests folder"
4. Gemini reports success and shows the relative path under the current project.
5. Search the filesystem for the created file.
In my case, the file was created in a different repository:
/home/jacques/repogit/data-model-core/mmm/tests/gemini_test_repo_parent.txt
instead of the active project.
Environment
- VS Code
- WSL (Ubuntu)
- Gemini in VS Code
- Active working directory:
/home/jacques/repogit/mmm-tools/FLUX
Additional context :
I ran a comparison test.
When I opened only the FLUX folder directly as the VS Code workspace root, Gemini created the file in the correct location.
When working in the broader parent workspace / repo context, Gemini reported the correct relative path in the UI, but the file was actually written into another project.
This suggests a workspace/path resolution bug, possibly involving stale context, parent repo handling, or wrong workspace resolution in WSL.
Contributor guide
Assessment
This issue has not been assessed yet.