Skip to content

Commit 44b8205

Browse files
feat: add search to fs_read, refactoring fs_read into different modes (#811)
* feat: add search to fs_read, refactoring fs_read into different modes * fix compile error * WIP * fix: prevent reading lines past end of file
1 parent 1faea1e commit 44b8205

File tree

4 files changed

+525
-265
lines changed

4 files changed

+525
-265
lines changed

crates/q_cli/src/cli/chat/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ where
498498
}
499499
let tool_uses = tool_uses.take().unwrap_or_default();
500500
if !tool_uses.is_empty() && !skip_printing_tools {
501-
self.print_tool_descriptions(&tool_uses)?;
501+
self.print_tool_descriptions(&tool_uses).await?;
502502

503503
execute!(
504504
self.output,
@@ -1334,7 +1334,7 @@ where
13341334

13351335
match skip_acceptance {
13361336
true => {
1337-
self.print_tool_descriptions(&queued_tools)?;
1337+
self.print_tool_descriptions(&queued_tools).await?;
13381338
Ok(ChatState::ExecuteTools(queued_tools))
13391339
},
13401340
false => Ok(ChatState::PromptUser {
@@ -1344,7 +1344,7 @@ where
13441344
}
13451345
}
13461346

1347-
fn print_tool_descriptions(&mut self, tool_uses: &[QueuedTool]) -> Result<(), ChatError> {
1347+
async fn print_tool_descriptions(&mut self, tool_uses: &[QueuedTool]) -> Result<(), ChatError> {
13481348
let terminal_width = self.terminal_width();
13491349
for (_, tool) in tool_uses.iter() {
13501350
queue!(
@@ -1357,6 +1357,7 @@ where
13571357
style::SetForegroundColor(Color::Reset),
13581358
)?;
13591359
tool.queue_description(&self.ctx, &mut self.output)
1360+
.await
13601361
.map_err(|e| ChatError::Custom(format!("failed to print tool: {}", e).into()))?;
13611362
queue!(self.output, style::Print("\n"))?;
13621363
}

0 commit comments

Comments
 (0)