agent: Do not reuse assistant message across generations (#29360)
#29354 introduced a bug where we would append tool uses to the last assistant message even if it was from a previous request. Release Notes: - N/A Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
This commit is contained in:
co-authored by
Bennet Bo Fenner
parent
b0609272c0
commit
58604fba86
@@ -453,9 +453,11 @@ impl CopilotChatLanguageModel {
|
||||
}
|
||||
}
|
||||
|
||||
messages.push(ChatMessage::User {
|
||||
content: text_content,
|
||||
});
|
||||
if !text_content.is_empty() {
|
||||
messages.push(ChatMessage::User {
|
||||
content: text_content,
|
||||
});
|
||||
}
|
||||
}
|
||||
Role::Assistant => {
|
||||
let mut tool_calls = Vec::new();
|
||||
|
||||
Reference in New Issue
Block a user