Refactor EditTool.Name to use centralized EDIT_TOOL_NAME (#11343)

This commit is contained in:
Abhi
2025-10-17 01:35:35 -04:00
committed by GitHub
parent d42da87161
commit 3a1d3769ae
6 changed files with 13 additions and 12 deletions
@@ -8,7 +8,7 @@
import type { Mock } from 'vitest';
import { vi, describe, it, expect, beforeEach, type Mocked } from 'vitest';
import * as fs from 'node:fs';
import { EditTool } from '../tools/edit.js';
import { EDIT_TOOL_NAME } from '../tools/tool-names.js';
import type { BaseLlmClient } from '../core/baseLlmClient.js';
// MOCKS
@@ -582,8 +582,8 @@ describe('editCorrector', () => {
parts: [
{
functionResponse: {
name: EditTool.Name,
id: `${EditTool.Name}-${lastEditTime}-123`,
name: EDIT_TOOL_NAME,
id: `${EDIT_TOOL_NAME}-${lastEditTime}-123`,
response: {
output: {
llmContent: `Successfully modified file: ${filePath}`,
+2 -3
View File
@@ -8,8 +8,7 @@ import type { Content, GenerateContentConfig } from '@google/genai';
import type { GeminiClient } from '../core/client.js';
import type { BaseLlmClient } from '../core/baseLlmClient.js';
import type { EditToolParams } from '../tools/edit.js';
import { EditTool } from '../tools/edit.js';
import { WRITE_FILE_TOOL_NAME } from '../tools/tool-names.js';
import { EDIT_TOOL_NAME, WRITE_FILE_TOOL_NAME } from '../tools/tool-names.js';
import { ReadFileTool } from '../tools/read-file.js';
import { ReadManyFilesTool } from '../tools/read-many-files.js';
import { GrepTool } from '../tools/grep.js';
@@ -101,7 +100,7 @@ async function findLastEditTimestamp(
// Tools that may reference the file path in their FunctionResponse `output`.
const toolsInResp = new Set([
WRITE_FILE_TOOL_NAME,
EditTool.Name,
EDIT_TOOL_NAME,
ReadManyFilesTool.Name,
GrepTool.Name,
]);