Require confirmation for fetch tool

This commit is contained in:
Conrad Irwin 2025-08-25 09:01:05 -06:00
parent 69127d2bea
commit 273a58bf66
2 changed files with 8 additions and 3 deletions

View file

@ -136,12 +136,17 @@ impl AgentTool for FetchTool {
fn run(
self: Arc<Self>,
input: Self::Input,
_event_stream: ToolCallEventStream,
event_stream: ToolCallEventStream,
cx: &mut App,
) -> Task<Result<Self::Output>> {
let authorize = event_stream.authorize(input.url.clone(), cx);
let text = cx.background_spawn({
let http_client = self.http_client.clone();
async move { Self::build_message(http_client, &input.url).await }
async move {
authorize.await?;
Self::build_message(http_client, &input.url).await
}
});
cx.foreground_executor().spawn(async move {

View file

@ -118,7 +118,7 @@ impl Tool for FetchTool {
}
fn needs_confirmation(&self, _: &serde_json::Value, _: &Entity<Project>, _: &App) -> bool {
false
true
}
fn may_perform_edits(&self) -> bool {