-
Notifications
You must be signed in to change notification settings - Fork 792
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Instructions from avante.md are appended to my user input twice before being sent to agents. This causes all instructions in that file to appear twice, leading to verbose and confusing prompt contexts.
To reproduce
- Place an avante.md file in the project root with some instructions.
- Use the Avante agent to send a request or open a code session in the normal way.
- Observe that the contents from avante.md are appended twice to the prompt before being sent to the language agents (e.g. via verbose logs, or reviewing the actual input sent).
Expected behavior
Instructions from avante.md should only be appended once to the user input before being sent to agents. The prompt context should not contain duplicate instruction blocks.
Installation method
NeoVim built-in pack.
Environment
NeoVim 0.12 nightly,
official update avante repo,
macOS 26.3
Repro
The issue is in `lua/avante/llm`. lua in the generate_prompts function. The `avante.md` file is being appended to both `opts.instructions` and `messages`.
The problem is: generate_prompts modifies opts.instructions directly (mutating the passed object), and if this function gets called multiple times with the same opts object, the avante.md content gets appended each time.Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working