fix: wrap user input in task only in agentic mode (#2636)
This commit is contained in:
@@ -404,16 +404,18 @@ function M.generate_prompts(opts)
|
|||||||
if msg.is_user_submission then
|
if msg.is_user_submission then
|
||||||
message = vim.deepcopy(message)
|
message = vim.deepcopy(message)
|
||||||
local content = message.content
|
local content = message.content
|
||||||
if type(content) == "string" then
|
if Config.mode == "agentic" then
|
||||||
message.content = "<task>" .. content .. "</task>"
|
if type(content) == "string" then
|
||||||
elseif type(content) == "table" then
|
message.content = "<task>" .. content .. "</task>"
|
||||||
for idx, item in ipairs(content) do
|
elseif type(content) == "table" then
|
||||||
if type(item) == "string" then
|
for idx, item in ipairs(content) do
|
||||||
item = "<task>" .. item .. "</task>"
|
if type(item) == "string" then
|
||||||
content[idx] = item
|
item = "<task>" .. item .. "</task>"
|
||||||
elseif type(item) == "table" and item.type == "text" then
|
content[idx] = item
|
||||||
item.content = "<task>" .. item.content .. "</task>"
|
elseif type(item) == "table" and item.type == "text" then
|
||||||
content[idx] = item
|
item.content = "<task>" .. item.content .. "</task>"
|
||||||
|
content[idx] = item
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user