From 0795e55f0e7d2f2822bcd83eaf066eb99c67f858 Mon Sep 17 00:00:00 2001 From: Tolik Malibroda <54813212+tolikmalibroda@users.noreply.github.com> Date: Mon, 2 Jun 2025 22:05:45 +0200 Subject: feat: Add --yolo mode that automatically accepts all tools executions (#695) Co-authored-by: N. Taylor Mullen --- packages/core/src/tools/write-file.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'packages/core/src/tools/write-file.ts') diff --git a/packages/core/src/tools/write-file.ts b/packages/core/src/tools/write-file.ts index 2285c819..2e04a10a 100644 --- a/packages/core/src/tools/write-file.ts +++ b/packages/core/src/tools/write-file.ts @@ -7,7 +7,7 @@ import fs from 'fs'; import path from 'path'; import * as Diff from 'diff'; -import { Config } from '../config/config.js'; +import { Config, ApprovalMode } from '../config/config.js'; import { BaseTool, ToolResult, @@ -143,7 +143,7 @@ export class WriteFileTool extends BaseTool { params: WriteFileToolParams, abortSignal: AbortSignal, ): Promise { - if (this.config.getAlwaysSkipModificationConfirmation()) { + if (this.config.getApprovalMode() === ApprovalMode.AUTO_EDIT) { return false; } @@ -186,7 +186,7 @@ export class WriteFileTool extends BaseTool { fileDiff, onConfirm: async (outcome: ToolConfirmationOutcome) => { if (outcome === ToolConfirmationOutcome.ProceedAlways) { - this.config.setAlwaysSkipModificationConfirmation(true); + this.config.setApprovalMode(ApprovalMode.AUTO_EDIT); } }, }; -- cgit v1.2.3