refactor: integrate resolver into read_file and shell tools

This commit is contained in:
Aishanee Shah
2026-02-06 19:13:34 +00:00
parent a4f780feb9
commit c5cb031155
2 changed files with 21 additions and 8 deletions
+6 -4
View File
@@ -24,6 +24,7 @@ import { FileOperationEvent } from '../telemetry/types.js';
import { READ_FILE_TOOL_NAME } from './tool-names.js';
import { FileDiscoveryService } from '../services/fileDiscoveryService.js';
import { READ_FILE_DEFINITION } from './definitions/coreTools.js';
import { resolveToolDeclaration } from './definitions/resolver.js';
/**
* Parameters for the ReadFile tool
@@ -235,9 +236,10 @@ export class ReadFileTool extends BaseDeclarativeTool<
);
}
override getSchema(_modelId?: string) {
// Pure refactor: maintain existing behavior.
// getSchema(modelId) is now available for future model-specific overrides.
return super.getSchema();
override getSchema(modelId?: string) {
if (!modelId) {
return super.getSchema();
}
return resolveToolDeclaration(READ_FILE_DEFINITION, modelId);
}
}