Skip to content

can't extract code snippets in aider #580

Closed
@yrobla

Description

@yrobla

Describe the issue

Aider structures the interaction with llms sending different user messages, when referencing files. So in one message it's sending the content of the code, and in the second message is sending the query for it.
As we only identify the last user message, is not able to recognize the code on this specific use case. To fix it, we need to read all the last block of 'user' messages, not just the last 'user' message.

Steps to Reproduce

Test something like:

aider /tmp/test.py
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Aider v0.71.1
Main model: gpt-4o-2024-08-06 with diff edit format
Weak model: gpt-4o-mini
Git repo: none
Repo-map: disabled
Added test.py to the chat.
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
test.py

evaluate this file

Operating System

MacOS (Arm)

IDE and Version

vscode

Extension and Version

aider

Provider

OpenAI

Model

gpt-4

Logs

No response

Additional Context

No response

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions