fix: clear plugin commands on reload to prevent duplicates
Add clearPluginCommands() call in loadClawdbotPlugins() to ensure previously registered commands are cleaned up before reloading plugins. This prevents command conflicts during hot-reload scenarios. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
b56587f26e
commit
f648aae440
1 changed files with 4 additions and 0 deletions
|
|
@ -16,6 +16,7 @@ import {
|
|||
type NormalizedPluginsConfig,
|
||||
} from "./config-state.js";
|
||||
import { initializeGlobalHookRunner } from "./hook-runner-global.js";
|
||||
import { clearPluginCommands } from "./commands.js";
|
||||
import { createPluginRegistry, type PluginRecord, type PluginRegistry } from "./registry.js";
|
||||
import { createPluginRuntime } from "./runtime/index.js";
|
||||
import { setActivePluginRegistry } from "./runtime.js";
|
||||
|
|
@ -178,6 +179,9 @@ export function loadClawdbotPlugins(options: PluginLoadOptions = {}): PluginRegi
|
|||
}
|
||||
}
|
||||
|
||||
// Clear previously registered plugin commands before reloading
|
||||
clearPluginCommands();
|
||||
|
||||
const runtime = createPluginRuntime();
|
||||
const { registry, createApi } = createPluginRegistry({
|
||||
logger,
|
||||
|
|
|
|||
Loading…
Reference in a new issue