Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cody applies changes to the wrong file when you work under the certain folder #6316

Open
DzmitrySudnik opened this issue Dec 11, 2024 · 7 comments
Assignees
Labels
bug Something isn't working repo/cody

Comments

@DzmitrySudnik
Copy link

DzmitrySudnik commented Dec 11, 2024

Version

v1.48.1

Describe the bug

In my setup I have a root folder with a bunch of subfolders, one of subfolders has the same name as the root one. When I try to use Smart Apply on a file in this subfolder Cody creates/updates files on one level up.

Expected behavior

Cody changes the file you are working on, it doesn't create copies of that file in other places.

Additional context

To reproduce:

  1. Create folders and a file like below:
    demo
    |- demo
    |-- |- test.py
  2. Open the top demo folder in VSCode
  3. Ask Cody to change anything in demo/demo/test.py
  4. Use Smart Apply
  5. Cody will create a new file:
    demo
    |- demo
    |-- |- test.py
    |- test.py <--- NEW FILE created by Cody with content of demo/demo/test.py

If I have a more complex structure under demo/demo Cody recreates the entire structure just on a one level up.

@DzmitrySudnik DzmitrySudnik added bug Something isn't working repo/cody labels Dec 11, 2024
Copy link

linear bot commented Dec 11, 2024

@PriNova PriNova self-assigned this Dec 11, 2024
@PriNova
Copy link
Collaborator

PriNova commented Dec 11, 2024

Hey @DzmitrySudnik

Thank you for reporting the issue.
If you ask Cody to change the suggested solution, does the Code Block in the chat show the filename in the bottom right corner or is it empty?
Screenshot 2024-12-11 160820

@DzmitrySudnik
Copy link
Author

DzmitrySudnik commented Dec 11, 2024

@PriNova it shows demo/test.py when I work with demo/demo/test.py. If I try to ask about a file under demo/test.py it shows just test.py, if I try demo/other/test.py it shows ohter/test.py but Smart apply works correctly here changing demo/other/test.py. It's only when I work with demo/demo/test.py the bug is reproduced.

@addynaik
Copy link

i have a similar issue -

my project name is tester. inside that i have another folder called tester with a file called xyz.py so the path to this file is tester/tester/xyz.py. when i provide this file as context for updates and request changes - it create a new file tester/xyz.py

@PriNova
Copy link
Collaborator

PriNova commented Dec 16, 2024

@addynaik @DzmitrySudnik

On which OS are you?

@addynaik
Copy link

I’m in MacOS

@DzmitrySudnik
Copy link
Author

I'm on Windows 11. The bug is reproduced both on a standalone desktop VSCode just working in a local Windows folder and on a remote linux backend over SSH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working repo/cody
Projects
None yet
Development

No branches or pull requests

3 participants