Skip to content

Commit 92dceb4

Browse files
authored
fix(chat): ensure user prompt is wrapped in a list (#1427)
Previously, the user prompt was not wrapped in a table when initializing the chat history, which could cause issues when the code expects a list of messages. This change ensures the prompt is always provided as a list with the correct structure. Closes #1426
1 parent 9a63e83 commit 92dceb4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lua/CopilotChat/init.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -894,8 +894,10 @@ function M.ask(prompt, config)
894894
history = M.chat:get_messages()
895895
else
896896
history = {
897-
content = prompt,
898-
role = constants.ROLE.USER,
897+
{
898+
content = prompt,
899+
role = constants.ROLE.USER,
900+
},
899901
}
900902
end
901903

0 commit comments

Comments
 (0)