feat: respect agents.md (#2376)

This commit is contained in:
yetone
2025-06-30 18:44:06 +08:00
committed by GitHub
parent d98f676e32
commit 68ead5d2f0
2 changed files with 27 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ local uv = vim.uv
local curl = require("plenary.curl")
local Utils = require("avante.utils")
local Prompts = require("avante.utils.prompts")
local Config = require("avante.config")
local Path = require("avante.path")
local Providers = require("avante.providers")
@@ -385,6 +386,9 @@ function M.generate_prompts(opts)
if opts.tools then tools = vim.list_extend(tools, opts.tools) end
if opts.prompt_opts and opts.prompt_opts.tools then tools = vim.list_extend(tools, opts.prompt_opts.tools) end
local agents_rules = Prompts.get_agents_rules_prompt()
if agents_rules then system_prompt = system_prompt .. "\n\n" .. agents_rules end
---@type AvantePromptOptions
return {
system_prompt = system_prompt,