fix(agent): satisfy clippy::if_not_else lint in tool history push
Flip conditional to use positive check (is_empty) in the if-branch to resolve clippy::if_not_else error in CI strict delta lint gate. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
0e5a785015
commit
0c46b56555
1 changed files with 3 additions and 3 deletions
|
|
@ -829,7 +829,9 @@ pub(crate) async fn run_tool_call_loop(
|
||||||
// reconstruct proper OpenAI-format tool_calls and tool result messages.
|
// reconstruct proper OpenAI-format tool_calls and tool result messages.
|
||||||
// Prompt mode: use XML-based text format as before.
|
// Prompt mode: use XML-based text format as before.
|
||||||
history.push(ChatMessage::assistant(assistant_history_content));
|
history.push(ChatMessage::assistant(assistant_history_content));
|
||||||
if !native_tool_calls.is_empty() {
|
if native_tool_calls.is_empty() {
|
||||||
|
history.push(ChatMessage::user(format!("[Tool results]\n{tool_results}")));
|
||||||
|
} else {
|
||||||
for (native_call, result) in native_tool_calls.iter().zip(individual_results.iter()) {
|
for (native_call, result) in native_tool_calls.iter().zip(individual_results.iter()) {
|
||||||
let tool_msg = serde_json::json!({
|
let tool_msg = serde_json::json!({
|
||||||
"tool_call_id": native_call.id,
|
"tool_call_id": native_call.id,
|
||||||
|
|
@ -837,8 +839,6 @@ pub(crate) async fn run_tool_call_loop(
|
||||||
});
|
});
|
||||||
history.push(ChatMessage::tool(tool_msg.to_string()));
|
history.push(ChatMessage::tool(tool_msg.to_string()));
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
history.push(ChatMessage::user(format!("[Tool results]\n{tool_results}")));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue