Skip to content

Commit 4d48616

Browse files
Copilotyiwang
andcommitted
Fix compilation errors: add Vec::new() to all chat_stream_with_tools calls and run cargo fmt
Co-authored-by: yiwang <142937+yiwang@users.noreply.github.com>
1 parent e0c7460 commit 4d48616

5 files changed

Lines changed: 22 additions & 16 deletions

File tree

crates/cli/src/cli/chat.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -467,16 +467,20 @@ pub async fn run(args: ChatArgs, agent_id: &str) -> Result<()> {
467467

468468
if !approved_calls.is_empty() {
469469
match agent
470-
.execute_streaming_tool_calls(&full_response, approved_calls, |name, args| {
471-
// Print tool call as it starts (including recursive calls)
472-
let detail = extract_tool_detail(name, args);
473-
if let Some(ref d) = detail {
474-
println!("\n[{}: {}]", name, d);
475-
} else {
476-
println!("\n[{}]", name);
477-
}
478-
let _ = stdout.flush();
479-
})
470+
.execute_streaming_tool_calls(
471+
&full_response,
472+
approved_calls,
473+
|name, args| {
474+
// Print tool call as it starts (including recursive calls)
475+
let detail = extract_tool_detail(name, args);
476+
if let Some(ref d) = detail {
477+
println!("\n[{}: {}]", name, d);
478+
} else {
479+
println!("\n[{}]", name);
480+
}
481+
let _ = stdout.flush();
482+
},
483+
)
480484
.await
481485
{
482486
Ok((follow_up, warnings)) => {

crates/cli/src/desktop/worker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ async fn worker_loop(
114114
match msg {
115115
UiMessage::Chat(message) => {
116116
// Stream response with tool support
117-
match agent.chat_stream_with_tools(&message).await {
117+
match agent.chat_stream_with_tools(&message, Vec::new()).await {
118118
Ok(stream) => {
119119
let mut stream = pin!(stream);
120120
let mut pending_tools: Vec<ToolCall> = Vec::new();

crates/core/src/agent/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ impl Agent {
639639
for call in &calls {
640640
// Notify caller that tool is starting
641641
on_tool_start(&call.name, &call.arguments);
642-
642+
643643
debug!(
644644
"Executing tool: {} with args: {}",
645645
call.name, call.arguments
@@ -1168,7 +1168,7 @@ impl Agent {
11681168
for call in &tool_calls {
11691169
// Notify caller that tool is starting
11701170
on_tool_start(&call.name, &call.arguments);
1171-
1171+
11721172
debug!(
11731173
"Executing tool: {} with args: {}",
11741174
call.name, call.arguments
@@ -1208,7 +1208,9 @@ impl Agent {
12081208
.await?;
12091209

12101210
// Handle the response (may have more tool calls)
1211-
let final_response = self.handle_response_with_callback(response, &mut on_tool_start).await?;
1211+
let final_response = self
1212+
.handle_response_with_callback(response, &mut on_tool_start)
1213+
.await?;
12121214

12131215
// Add final response to session
12141216
self.session.add_message(Message {

crates/server/src/http.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ async fn chat_stream(
792792
entry.dirty = true;
793793

794794
// Use streaming with tools
795-
match entry.agent.chat_stream_with_tools(&message).await {
795+
match entry.agent.chat_stream_with_tools(&message, Vec::new()).await {
796796
Ok(event_stream) => {
797797
use futures::StreamExt;
798798

crates/server/src/telegram.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ async fn handle_chat(
693693
entry.last_accessed = Instant::now();
694694

695695
// Use streaming with tools
696-
let response = match entry.agent.chat_stream_with_tools(text).await {
696+
let response = match entry.agent.chat_stream_with_tools(text, Vec::new()).await {
697697
Ok(event_stream) => {
698698
use futures::StreamExt;
699699

0 commit comments

Comments
 (0)