diff --git a/src/plugin-dispose.test.ts b/src/plugin-dispose.test.ts index d0dd0285b..955254c19 100644 --- a/src/plugin-dispose.test.ts +++ b/src/plugin-dispose.test.ts @@ -12,14 +12,10 @@ describe("createPluginDispose", () => { const skillMcpManager = { disconnectAll: async (): Promise => {}, } - const lspManager = { - stopAll: async (): Promise => {}, - } const shutdownSpy = spyOn(backgroundManager, "shutdown") const dispose = createPluginDispose({ backgroundManager, skillMcpManager, - lspManager, disposeHooks: (): void => {}, }) @@ -38,14 +34,10 @@ describe("createPluginDispose", () => { const skillMcpManager = { disconnectAll: async (): Promise => {}, } - const lspManager = { - stopAll: async (): Promise => {}, - } const disconnectAllSpy = spyOn(skillMcpManager, "disconnectAll") const dispose = createPluginDispose({ backgroundManager, skillMcpManager, - lspManager, disposeHooks: (): void => {}, }) @@ -73,9 +65,6 @@ describe("createPluginDispose", () => { const autoSlashCommand = { dispose: (): void => {}, } - const lspManager = { - stopAll: async (): Promise => {}, - } const claudeCodeHooksDisposeSpy = spyOn(claudeCodeHooks, "dispose") const commentCheckerDisposeSpy = spyOn(commentChecker, "dispose") const runtimeFallbackDisposeSpy = spyOn(runtimeFallback, "dispose") @@ -88,7 +77,6 @@ describe("createPluginDispose", () => { skillMcpManager: { disconnectAll: async (): Promise => {}, }, - lspManager, disposeHooks: (): void => { disposeCreatedHooks({ claudeCodeHooks, @@ -119,20 +107,15 @@ describe("createPluginDispose", () => { const skillMcpManager = { disconnectAll: async (): Promise => {}, } - const lspManager = { - stopAll: async (): Promise => {}, - } const disposeHooks = { run: (): void => {}, } const shutdownSpy = spyOn(backgroundManager, "shutdown") const disconnectAllSpy = spyOn(skillMcpManager, "disconnectAll") - const stopAllSpy = spyOn(lspManager, "stopAll") const disposeHooksSpy = spyOn(disposeHooks, "run") const dispose = createPluginDispose({ backgroundManager, skillMcpManager, - lspManager, disposeHooks: disposeHooks.run, }) @@ -143,7 +126,6 @@ describe("createPluginDispose", () => { // then expect(shutdownSpy).toHaveBeenCalledTimes(1) expect(disconnectAllSpy).toHaveBeenCalledTimes(1) - expect(stopAllSpy).toHaveBeenCalledTimes(1) expect(disposeHooksSpy).toHaveBeenCalledTimes(1) }) @@ -157,15 +139,11 @@ describe("createPluginDispose", () => { const skillMcpManager = { disconnectAll: async (): Promise => {}, } - const lspManager = { - stopAll: async (): Promise => {}, - } const disposeHooksCalls: number[] = [] const disconnectAllSpy = spyOn(skillMcpManager, "disconnectAll") const dispose = createPluginDispose({ backgroundManager, skillMcpManager, - lspManager, disposeHooks: (): void => { disposeHooksCalls.push(1) }, @@ -189,15 +167,11 @@ describe("createPluginDispose", () => { throw new Error("disconnectAll failed") }, } - const lspManager = { - stopAll: async (): Promise => {}, - } const disposeHooksCalls: number[] = [] const shutdownSpy = spyOn(backgroundManager, "shutdown") const dispose = createPluginDispose({ backgroundManager, skillMcpManager, - lspManager, disposeHooks: (): void => { disposeHooksCalls.push(1) }, @@ -210,28 +184,4 @@ describe("createPluginDispose", () => { expect(shutdownSpy).toHaveBeenCalledTimes(1) expect(disposeHooksCalls).toHaveLength(1) }) - - test("#given active LSP clients #when dispose runs #then lsp manager is stopped", async () => { - // given - const lspManager = { - stopAll: async (): Promise => {}, - } - const stopAllSpy = spyOn(lspManager, "stopAll") - const dispose = createPluginDispose({ - backgroundManager: { - shutdown: async (): Promise => {}, - }, - skillMcpManager: { - disconnectAll: async (): Promise => {}, - }, - lspManager, - disposeHooks: (): void => {}, - }) - - // when - await dispose() - - // then - expect(stopAllSpy).toHaveBeenCalledTimes(1) - }) }) diff --git a/src/plugin/tool-execute-before.test.ts b/src/plugin/tool-execute-before.test.ts index 516c97d48..7facf671d 100644 --- a/src/plugin/tool-execute-before.test.ts +++ b/src/plugin/tool-execute-before.test.ts @@ -1,7 +1,6 @@ const { afterEach, describe, expect, test } = require("bun:test") const { createToolExecuteBeforeHandler } = require("./tool-execute-before") const { createToolRegistry } = require("./tool-registry") -const { builtinTools } = require("../tools") const { resetStorageClient } = require("../tools/session-manager/storage") describe("createToolExecuteBeforeHandler", () => { @@ -335,13 +334,16 @@ describe("createToolRegistry", () => { describe("#given max_tools is lower than or equal to builtin tool count", () => { describe("#when creating the tool registry", () => { test("#then it trims to the exact configured cap", () => { + const baseline = createToolRegistry(createRegistryInput()) + const baselineToolCount = Object.keys(baseline.filteredTools).length + const result = createToolRegistry( createRegistryInput({ - experimental: { max_tools: Object.keys(builtinTools).length }, + experimental: { max_tools: baselineToolCount }, }), ) - expect(Object.keys(result.filteredTools)).toHaveLength(Object.keys(builtinTools).length) + expect(Object.keys(result.filteredTools)).toHaveLength(baselineToolCount) }) }) }) diff --git a/src/plugin/tool-registry.team-mode.test.ts b/src/plugin/tool-registry.team-mode.test.ts index d858dee45..7710742a4 100644 --- a/src/plugin/tool-registry.team-mode.test.ts +++ b/src/plugin/tool-registry.team-mode.test.ts @@ -63,7 +63,6 @@ describe("team-mode tool registry wiring", () => { }, availableCategories: [], toolFactories: { - builtinTools: { bash: fakeTool, read: fakeTool }, createBackgroundTools: mock(() => ({})), createCallOmoAgent: mock(() => fakeTool), createLookAt: mock(() => fakeTool), diff --git a/src/plugin/tool-registry.test.ts b/src/plugin/tool-registry.test.ts index 7fc2f1723..03a8ec5a9 100644 --- a/src/plugin/tool-registry.test.ts +++ b/src/plugin/tool-registry.test.ts @@ -46,7 +46,6 @@ const TEAM_TOOL_NAMES = [ const { createToolRegistry, trimToolsToCap } = await import("./tool-registry") const toolFactories: NonNullable[0]["toolFactories"]> = { - builtinTools: { bash: fakeTool, read: fakeTool }, createBackgroundTools: mock(() => ({})), createCallOmoAgent: mock(() => fakeTool), createLookAt: mock(() => fakeTool),