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/edit.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/edit.ts')
| -rw-r--r-- | packages/core/src/tools/edit.ts | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/packages/core/src/tools/edit.ts b/packages/core/src/tools/edit.ts index 2df01a22..f388b9f5 100644 --- a/packages/core/src/tools/edit.ts +++ b/packages/core/src/tools/edit.ts @@ -18,7 +18,6 @@ import { import { SchemaValidator } from '../utils/schemaValidator.js'; import { makeRelative, shortenPath } from '../utils/paths.js'; import { isNodeError } from '../utils/errors.js'; -import { GeminiClient } from '../core/client.js'; import { Config, ApprovalMode } from '../config/config.js'; import { ensureCorrectEdit } from '../utils/editCorrector.js'; import { DEFAULT_DIFF_OPTIONS } from './diffOptions.js'; @@ -72,15 +71,13 @@ export class EditTool implements ModifiableTool<EditToolParams> { static readonly Name = 'replace'; - private readonly config: Config; private readonly rootDirectory: string; - private readonly client: GeminiClient; /** * Creates a new instance of the EditLogic * @param rootDirectory Root directory to ground this tool in. */ - constructor(config: Config) { + constructor(private readonly config: Config) { super( EditTool.Name, 'Edit', @@ -123,9 +120,7 @@ Expectation for required parameters: type: 'object', }, ); - this.config = config; this.rootDirectory = path.resolve(this.config.getTargetDir()); - this.client = config.getGeminiClient(); } /** @@ -239,7 +234,7 @@ Expectation for required parameters: params.file_path, currentContent, params, - this.client, + this.config.getGeminiClient(), abortSignal, ); finalOldString = correctedEdit.params.old_string; |
