aboutsummaryrefslogtreecommitdiffstats
path: root/src/agent.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/agent.rs')
-rw-r--r--src/agent.rs19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/agent.rs b/src/agent.rs
index 9e2a431..77807ae 100644
--- a/src/agent.rs
+++ b/src/agent.rs
@@ -302,16 +302,19 @@ fn execute(
302 Err(error) => ToolOutcome::Failed(error), 302 Err(error) => ToolOutcome::Failed(error),
303 }, 303 },
304 Approval::Once => match tools::plan(&call.name, &args) { 304 Approval::Once => match tools::plan(&call.name, &args) {
305 Ok(change) => { 305 Ok(change) => match change.preview() {
306 if approver.allow_edit(change.path(), &change.preview()) { 306 Ok(preview) => {
307 match change.apply() { 307 if approver.allow_edit(change.path(), &preview) {
308 Ok(output) => ToolOutcome::Ok(output), 308 match change.apply() {
309 Err(error) => ToolOutcome::Failed(error), 309 Ok(output) => ToolOutcome::Ok(output),
310 Err(error) => ToolOutcome::Failed(error),
311 }
312 } else {
313 ToolOutcome::Denied
310 } 314 }
311 } else {
312 ToolOutcome::Denied
313 } 315 }
314 } 316 Err(error) => ToolOutcome::Failed(error),
317 },
315 Err(error) => ToolOutcome::Failed(error), 318 Err(error) => ToolOutcome::Failed(error),
316 }, 319 },
317 Approval::EveryCall => { 320 Approval::EveryCall => {