Aider-AI / aider

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

Issues with File Suggestions and Multi-Line Chat #2223

Open FelixLisczyk opened 3 weeks ago

FelixLisczyk commented 3 weeks ago

Hi Paul,

First off, I want to express my gratitude for your amazing work on Aider. It's been incredibly helpful in my projects, and I'm really enjoying using it.

I've encountered a few issues related to adding files to the chat and handling suggestions. To reproduce these issues, you can create a new repository with a single empty file named "My File.txt". Here's what I've noticed:

  1. Case-Sensitivity in Suggestions:

    • When using the /read-only command, the file suggestions seem to be case-sensitive.
    • For example, typing /read-only m doesn't show any suggestions, but /add m correctly suggests "My File.txt".
  2. Incomplete Replacement of Suggestions:

    • Typing /add my f and then selecting the suggestion for "My File.txt" only replaces the last part ("m"), leaving "my" unchanged.
    • This leads to Aider asking if I want to create a new file, which isn't what I intended.
  3. Multi-line Chat File Addition Issue:

    • When using the /add command within multi-line chat blocks (curly braces), the added files don't appear in the Aider UI.
    • It seems like the file is added to the session but doesn't show up in the UI, which can be a bit confusing.
    • I've attached the relevant terminal output below.

Expected Behavior:

Additional Information: Here's an example of what I'm seeing in the terminal when I encounter the multi-line chat issue:

Aider v0.61.0
Main model: claude-3-5-sonnet-20241022 with diff edit format, prompt cache, infinite output
Weak model: claude-3-haiku-20240307
Git repo: .git with 2 files
Repo-map: using 1024 tokens, files refresh
Use /help <question> for help, run "aider --help" to see cmd line args
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Read only files:
../../.aider.conventions.md
> {
. /add "My File.txt"
. Which files do you see?
. }

I see the following file has been added to the chat:

My File.txt

I can now propose edits to this file using SEARCH/REPLACE blocks. What changes would you like me to make to it?

Tokens: 4.7k sent, 2.0k cache write, 54 received. Cost: $0.02 message, $0.02 session.
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Read only files:
../../.aider.conventions.md
> /ls

Repo files not in the chat:

  .gitignore
  My File.txt

Read-only files:

  ../../.aider.conventions.md

Thanks again for your fantastic work on Aider! Please let me know if there's any other information you need from my end.


Environment:

Aider version: 0.61.0 Python version: 3.12.7 Platform: macOS-15.1-arm64-arm-64bit Python implementation: CPython Virtual environment: Yes OS: Darwin 24.1.0 (64bit) Git version: git version 2.39.5 (Apple Git-154)

Aider v0.61.0 Main model: claude-3-5-sonnet-20241022 with diff edit format, prompt cache, infinite output Weak model: claude-3-haiku-20240307 Git repo: .git with 2 files Repo-map: using 1024 tokens, files refresh

paul-gauthier commented 2 weeks ago

Thanks for trying aider and filing this issue.

You can't use { and /-commands.

FelixLisczyk commented 2 weeks ago

Thanks for the quick response! I apologize if I wasn't clear enough in my report. Let me clarify:

The first two issues occur independently of multi-line chats:

  1. The case-sensitivity in /read-only suggestions vs /add suggestions
  2. The partial replacement of text when accepting file suggestions (e.g., typing /add my f and selecting "My File.txt" suggestion)

Regarding the third issue about commands in multi-line chats: I understand that this might not be supported functionality. However, it would be really helpful if it were possible. I often find myself in the middle of answering the AI's clarifying questions when I realize I forgot to add a relevant file to the chat.

Interestingly, the current behavior seems to partially work - in my example, the AI could see and acknowledge the added file, even though the UI didn't reflect this change. Would it be possible to fully support commands in multi-line chats, or is there a technical limitation preventing this?

Thanks again for your work on this project!

paul-gauthier commented 3 days ago

I'm labeling this issue as stale because it has been open for 2 weeks with no activity. If there are no additional comments, I will close it in 7 days.Note: A bot script made these updates to the issue.

FelixLisczyk commented 2 days ago

I am still experiencing all three issues in the latest version of Aider 0.65.1.

paul-gauthier commented 2 days ago
  1. /read does case-insensitive matching for me:

    2024-11-27_08-59-49
  2. I typed "add m" and it completed the file correctly:

    2024-11-27_09-01-10
  3. As I said, you can't use curly braces with / commands. I recommend using /editor if you need to do very long /add commands.

FelixLisczyk commented 2 days ago
  1. /read does case-insensitive matching for me:

Your screenshot shows you're using /add instead of /read-only. The issue only occurs when using the /read-only command.

  1. I typed "add m" and it completed the file correctly:

Here is a screen recording demonstrating the issue:

https://github.com/user-attachments/assets/f117ed2d-673a-44bd-8ce5-b35225078f51

  1. As I said, you can't use curly braces with / commands. I recommend using /editor if you need to do very long /add commands.

Thanks, I will try the /editor command.