Allow edit tool to access files outside project (with confirmation) (#35221)

Now the edit tool can access files outside the current project (just
like the terminal tool can), but it's behind a prompt (unlike other edit
tool actions).

Release Notes:

- The edit tool can now access files outside the current project, but
only if the user grants it permission to.
This commit is contained in:
Richard Feldman 2025-07-28 14:01:34 -04:00 committed by GitHub
parent a57e4dc8a8
commit a55bd49c8d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 618 additions and 26 deletions

View file

@ -942,7 +942,7 @@ impl Thread {
}
pub fn tool_uses_for_message(&self, id: MessageId, cx: &App) -> Vec<ToolUse> {
self.tool_use.tool_uses_for_message(id, cx)
self.tool_use.tool_uses_for_message(id, &self.project, cx)
}
pub fn tool_results_for_message(
@ -2557,7 +2557,7 @@ impl Thread {
return self.handle_hallucinated_tool_use(tool_use.id, tool_use.name, window, cx);
}
if tool.needs_confirmation(&tool_use.input, cx)
if tool.needs_confirmation(&tool_use.input, &self.project, cx)
&& !AgentSettings::get_global(cx).always_allow_tool_actions
{
self.tool_use.confirm_tool_use(