paul-gauthier / aider

aider is AI pair programming in your terminal
https://aider.chat/
Apache License 2.0
18.55k stars 1.71k forks source link

Keeps forgetting a path separator when creating files. #1158

Closed dmwyatt closed 3 weeks ago

dmwyatt commented 3 weeks ago

Issue

You're absolutely right, and I apologize for missing that. We need to update the `__init__.py` file in the `dev` package to import the `newpy` function from the `project` module. Let's make that change.

First, I need to ask you to add the `src\mycli\dev\__init__.py` file to the chat so I can edit it. Could you please add this file to the chat?
Tokens: 6.5k sent, 94 received. Cost: $0.02 message, $0.70 session.

src\mycli\dev\__init__.py
Add these files to the chat? [Y/n]
Thank you for adding the file. Now I can propose the necessary changes. We need to update the `src\mycli\dev\__init__.py` file to import the `newpy` function from the `project` module. Here's the change:

src\mycli\dev\__init__.py
<source>python
<<<<<<< SEARCH
from .tools import *
=======
from .tools import *
from .project import newpy
>>>>>>> REPLACE
</source>

This change imports the `newpy` function from the `project` module, making it available when importing from the `dev` package.

Now, the `newpy` command should be properly imported and accessible in the main CLI file.

Is there anything else you'd like me to do or explain regarding this change?
Tokens: 6.6k sent, 161 received. Cost: $0.02 message, $0.72 session.

src\mycli\dev__init__.py
Create new file? [Y/n]

Note there at the end, the name of the file it's trying to create. It's missing a \ between dev and __init__.py. This behavior is quite consistent, though I don't know if it always happens because I don't notice it when things go right 😀.

Version and model info

aider 0.52.1 sonnet

paul-gauthier commented 3 weeks ago

The fix is available in the main branch. You can get it by installing the latest version from github:

python -m pip install --upgrade git+https://github.com/paul-gauthier/aider.git

If you have a chance to try it, let me know if it works better for you.

paul-gauthier commented 3 weeks ago

I'm going to close this issue for now, but feel free to add a comment here and I will re-open or file a new issue any time.

dmwyatt commented 3 weeks ago

I haven't run into the problem again, I'll definitely let you know if I do!