-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Generated Markdown output confuses aider if backtick fencing is used. #2424
Comments
Thanks for trying aider and filing this issue. This doc may be helpful: |
Yes, but it doesn't address the issue. The main advice there is to try more capable model, but I also tried with GPT-4o and Claude Sonnet 3.5, and both produced the same result. It makes sense, because Aider relies on backticks as code blocks boundaries, and they work OK unless there are embedded backticks such as when generating Markdown. I think it would be better to switch to XML tags and not rely on backticks to designate code blocks. Most models are trained on tool usage, and XML tags will give more flexibility to aider and will be more reliable at the end. Another (probably simpler to implement) option would be to use more backticks to designate code blocks. |
Aider uses a different set of fences when editing files with triple-backtick fences. Can you show me a clear example of output with a strong model like Sonnet that demonstrates the problem you are experiencing? |
OK, here is output from my playground repo without pretty print using Sonnet: $ aider --no-pretty
Aider v0.63.2
Main model: claude-3-5-sonnet-20241022 with diff edit format, infinite output
Weak model: claude-3-5-haiku-20241022
Git repo: .git with 10 files
Repo-map: using 1024 tokens, auto refresh
VSCode terminal detected, pretty output has been disabled.
Use /help <question> for help, run "aider --help" to see cmd line args
> /architect generate a README file describing scripts and their command line arguments
I'll help create a README.md file that documents the scripts and their usage. Based on the file summaries shown, here are the instructions:
Create a new file `README.md` with this content:
```markdown
# Email Processing Scripts
A collection of utilities for processing, summarizing, and managing emails.
## Scripts
### process_unread_emails.py
Process and summarize unread emails.
```bash
python process_unread_emails.py --maildir PATH --db PATH [--ollama-url URL] [--verbose]
```
Arguments: Here is how it looks like on the screen with pretty print: |
As you can see, it uses the same triple backtick fencing. After it sees the first closing backtick, it interprets the rest of output as general stream, and then proceeds to ask whether I want to create a bunch of files. I think I know what happened. You said it uses different set of fences when EDITING files with fences, but in this case it creates a new file, so it doesn't really know. |
Issue
Asked to generate README for my repository and caused a glitch in aider after the first closing backticks and resulted in it creating a bunch of unnecessary files instead, as the rest was treated not as actual Markdown file, but as guidance for aider itself.
Command:
/architect create README describing scripts in this repository and how to use them (including how to set environment variables)
Output (redacted to remove sensitive information):
Version and model info
Aider v0.63.2
Model: ollama/qwen2.5-coder-tools-14b-32768:latest with whole edit format
Git repo: .git with 6 files
Repo-map: using 1024 tokens, auto refresh
VSCode terminal detected, pretty output has been disabled.
The text was updated successfully, but these errors were encountered: