

























@@ -26,9 +26,14 @@ import { clearPluginCommands, getPluginCommandSpecs } from "./command-registry-s
2626import { getGlobalHookRunner, resetGlobalHookRunner } from "./hook-runner-global.js";
2727import { createHookRunner } from "./hooks.js";
2828import {
29+clearPluginInteractiveHandlerRegistrations,
2930clearPluginInteractiveHandlers,
3031resolvePluginInteractiveNamespaceMatch,
3132} from "./interactive-registry.js";
33+import {
34+claimPluginInteractiveCallbackDedupe,
35+commitPluginInteractiveCallbackDedupe,
36+} from "./interactive-state.js";
3237import {
3338__testing,
3439clearPluginLoaderCache,
@@ -3217,8 +3222,16 @@ module.exports = { id: "throws-after-import", register() {} };`,
32173222]);
32183223expect(resolvePluginInteractiveNamespaceMatch("telegram", "hue:on")).toBeDefined();
321932243225+const dedupeKey = "telegram:hue:callback-1";
3226+expect(claimPluginInteractiveCallbackDedupe(dedupeKey, 1_000)).toBe(true);
3227+commitPluginInteractiveCallbackDedupe(dedupeKey, 1_000);
3228+expect(claimPluginInteractiveCallbackDedupe(dedupeKey, 1_001)).toBe(false);
3229+3230+loadOpenClawPlugins(loadOptions);
3231+expect(claimPluginInteractiveCallbackDedupe(dedupeKey, 1_002)).toBe(false);
3232+32203233clearPluginCommands();
3221-clearPluginInteractiveHandlers();
3234+clearPluginInteractiveHandlerRegistrations();
32223235expect(getPluginCommandSpecs()).toEqual([]);
32233236expect(resolvePluginInteractiveNamespaceMatch("telegram", "hue:on")).toBeNull();
32243237@@ -3234,6 +3247,7 @@ module.exports = { id: "throws-after-import", register() {} };`,
32343247namespace: "hue",
32353248channel: "telegram",
32363249});
3250+expect(claimPluginInteractiveCallbackDedupe(dedupeKey, 1_003)).toBe(false);
32373251});
3238325232393253it("clears stale detached task runtime registrations on active reloads when no plugin re-registers one", () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。