refactor(core): model-dependent tool definitions (#18563)

This commit is contained in:
Aishanee Shah
2026-02-09 15:46:23 -05:00
committed by GitHub
parent e6241907d6
commit dc942f4e35
16 changed files with 550 additions and 102 deletions
@@ -261,6 +261,17 @@ describe('ToolRegistry', () => {
toolRegistry.registerTool(tool);
expect(toolRegistry.getTool('mock-tool')).toBe(tool);
});
it('should pass modelId to getSchema when getting function declarations', () => {
const tool = new MockTool({ name: 'mock-tool' });
const getSchemaSpy = vi.spyOn(tool, 'getSchema');
toolRegistry.registerTool(tool);
const modelId = 'test-model-id';
toolRegistry.getFunctionDeclarations(modelId);
expect(getSchemaSpy).toHaveBeenCalledWith(modelId);
});
});
describe('excluded tools', () => {