fix: ignore error when reading file from tool_use (#2083)

This commit is contained in:
yetone
2025-05-26 18:53:02 +08:00
committed by GitHub
parent 9791bdc71e
commit 0e7d66333d

View File

@@ -291,8 +291,7 @@ function M.generate_prompts(opts)
item.content =
string.format("The file %s has been updated. Please use the latest `view` tool result!", path)
else
local lines, error = Utils.read_file_from_buf_or_disk(path)
if error ~= nil then Utils.error("error reading file: " .. error) end
local lines = Utils.read_file_from_buf_or_disk(path)
lines = lines or {}
item.content = table.concat(lines, "\n")
end