mirror of
https://github.com/aaif-goose/goose.git
synced 2026-07-03 14:10:03 +02:00
fix: handle truncated tool calls that break conversation alternation (#7424)
This commit is contained in:
@@ -1443,6 +1443,16 @@ impl Agent {
|
||||
.lock().await.clone();
|
||||
yield AgentEvent::Message(final_response.clone());
|
||||
messages_to_add.push(final_response);
|
||||
} else {
|
||||
let error_msg = format!(
|
||||
"[system: Tool call could not be parsed: {}. The response may have been truncated. Try breaking the task into smaller steps.]",
|
||||
request.tool_call.as_ref().unwrap_err(),
|
||||
);
|
||||
let error_response = Message::user()
|
||||
.with_generated_id()
|
||||
.with_text(&error_msg);
|
||||
yield AgentEvent::Message(error_response.clone());
|
||||
messages_to_add.push(error_response);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user