diff options
| author | Tommaso Sciortino <[email protected]> | 2025-07-07 15:01:59 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-07 22:01:59 +0000 |
| commit | 357546a2aac918702f6ebfa4a97bd95ccd614e5d (patch) | |
| tree | 27a7bc0967c0177533d2eb61989bc5bd26326833 /packages/core/src/tools/write-file.ts | |
| parent | aa10ccba713d49bef6bf474bfd72c0852e3da611 (diff) | |
Initialize MCP tools once at start up instead of every time we auth. (#3483)
Diffstat (limited to 'packages/core/src/tools/write-file.ts')
| -rw-r--r-- | packages/core/src/tools/write-file.ts | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/packages/core/src/tools/write-file.ts b/packages/core/src/tools/write-file.ts index 37a1ba78..ab30891b 100644 --- a/packages/core/src/tools/write-file.ts +++ b/packages/core/src/tools/write-file.ts @@ -23,7 +23,6 @@ import { ensureCorrectEdit, ensureCorrectFileContent, } from '../utils/editCorrector.js'; -import { GeminiClient } from '../core/client.js'; import { DEFAULT_DIFF_OPTIONS } from './diffOptions.js'; import { ModifiableTool, ModifyContext } from './modifiable-tool.js'; import { getSpecificMimeType } from '../utils/fileUtils.js'; @@ -67,7 +66,6 @@ export class WriteFileTool implements ModifiableTool<WriteFileToolParams> { static readonly Name: string = 'write_file'; - private readonly client: GeminiClient; constructor(private readonly config: Config) { super( @@ -92,8 +90,6 @@ export class WriteFileTool type: 'object', }, ); - - this.client = this.config.getGeminiClient(); } /** @@ -374,7 +370,7 @@ export class WriteFileTool new_string: proposedContent, file_path: filePath, }, - this.client, + this.config.getGeminiClient(), abortSignal, ); correctedContent = correctedParams.new_string; @@ -382,7 +378,7 @@ export class WriteFileTool // This implies new file (ENOENT) correctedContent = await ensureCorrectFileContent( proposedContent, - this.client, + this.config.getGeminiClient(), abortSignal, ); } |
