From ea19c518e42d08bebd9fcc3c7c969d12d7da5417 Mon Sep 17 00:00:00 2001 From: Marc J Saint-jour <82672745+Junebugg1214@users.noreply.github.com> Date: Thu, 12 Mar 2026 21:41:23 -0400 Subject: [PATCH] fix: decouple command cache version tracking --- src/auto-reply/commands-registry.data.ts | 31 ++++++++---------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/src/auto-reply/commands-registry.data.ts b/src/auto-reply/commands-registry.data.ts index 77277ced72a..98b2d5f1e28 100644 --- a/src/auto-reply/commands-registry.data.ts +++ b/src/auto-reply/commands-registry.data.ts @@ -125,7 +125,8 @@ function assertCommandRegistry(commands: ChatCommandDefinition[]): void { let cachedCommands: ChatCommandDefinition[] | null = null; let cachedNativeCommandSurfaces: Set | null = null; -let cachedPluginRegistryVersion: number | null = null; +let cachedCommandsPluginRegistryVersion: number | null = null; +let cachedNativeCommandSurfacesPluginRegistryVersion: number | null = null; function buildChatCommands(): ChatCommandDefinition[] { const commands: ChatCommandDefinition[] = [ @@ -604,22 +605,6 @@ function buildChatCommands(): ChatCommandDefinition[] { ], argsMenu: "auto", }), - defineChatCommand({ - key: "fast", - nativeName: "fast", - description: "Toggle fast mode.", - textAlias: "/fast", - category: "options", - args: [ - { - name: "mode", - description: "status, on, or off", - type: "string", - choices: ["status", "on", "off"], - }, - ], - argsMenu: "auto", - }), defineChatCommand({ key: "reasoning", nativeName: "reasoning", @@ -775,19 +760,23 @@ function buildChatCommands(): ChatCommandDefinition[] { export function getChatCommands(): ChatCommandDefinition[] { const registryVersion = getActivePluginRegistryVersion(); - if (cachedCommands && cachedPluginRegistryVersion === registryVersion) { + if (cachedCommands && cachedCommandsPluginRegistryVersion === registryVersion) { return cachedCommands; } const commands = buildChatCommands(); cachedCommands = commands; cachedNativeCommandSurfaces = null; - cachedPluginRegistryVersion = registryVersion; + cachedCommandsPluginRegistryVersion = registryVersion; + cachedNativeCommandSurfacesPluginRegistryVersion = null; return commands; } export function getNativeCommandSurfaces(): Set { const registryVersion = getActivePluginRegistryVersion(); - if (cachedNativeCommandSurfaces && cachedPluginRegistryVersion === registryVersion) { + if ( + cachedNativeCommandSurfaces && + cachedNativeCommandSurfacesPluginRegistryVersion === registryVersion + ) { return cachedNativeCommandSurfaces; } cachedNativeCommandSurfaces = new Set( @@ -795,6 +784,6 @@ export function getNativeCommandSurfaces(): Set { .filter((dock) => dock.capabilities.nativeCommands) .map((dock) => dock.id), ); - cachedPluginRegistryVersion = registryVersion; + cachedNativeCommandSurfacesPluginRegistryVersion = registryVersion; return cachedNativeCommandSurfaces; }