diff --git a/lua/avante/templates/base.avanterules b/lua/avante/templates/base.avanterules
index a196d4a..b2953cf 100644
--- a/lua/avante/templates/base.avanterules
+++ b/lua/avante/templates/base.avanterules
@@ -11,6 +11,7 @@ Act as an expert software developer.
Always use best practices when coding.
Respect and use existing conventions, libraries, etc that are already present in the code base.
You have access to tools, but only use them when necessary. If a tool is not required, respond as normal.
+If you encounter a URL, prioritize using the fetch tool to obtain its content.
If you have information that you don't know, please proactively use the tools provided by users! Especially the web search tool.
{% if system_info -%}
diff --git a/lua/avante/templates/planning.avanterules b/lua/avante/templates/planning.avanterules
index e887e30..650b91b 100644
--- a/lua/avante/templates/planning.avanterules
+++ b/lua/avante/templates/planning.avanterules
@@ -106,6 +106,23 @@ Every *SEARCH/REPLACE block* must use this format:
6. The lines to replace into the source code
7. The end of the replace block:
8. Please *DO NOT* put *SEARCH/REPLACE block* inside three backticks: {%raw%}```{%endraw%}
+10. Each block start and end tag must be on a separate line, and the lines they are on cannot contain anything else, I BEG YOU!
+
+This is bad case:
+
+
+foo
+
+bar
+
+This is good case:
+
+
+foo
+
+
+bar
+
Use the *FULL* file path, as shown to you by the user.
diff --git a/lua/avante/utils/init.lua b/lua/avante/utils/init.lua
index 881cc40..8921c05 100644
--- a/lua/avante/utils/init.lua
+++ b/lua/avante/utils/init.lua
@@ -914,7 +914,7 @@ function M.read_file_from_buf_or_disk(file_path)
return vim.split(content, "\n"), file_type, nil
else
M.error("failed to open file: " .. file_path .. " with error: " .. open_err)
- return nil, nil, open_err
+ return {}, nil, open_err
end
end