diff --git a/apps/memos-local-openclaw/index.ts b/apps/memos-local-openclaw/index.ts index 30e03439..01a344b5 100644 --- a/apps/memos-local-openclaw/index.ts +++ b/apps/memos-local-openclaw/index.ts @@ -351,8 +351,12 @@ const memosLocalPlugin = { // ─── Check allowPromptInjection policy ─── // When allowPromptInjection=false, the prompt mutation fields (such as prependContext) in the hook return value // will be stripped by the framework. Skip auto-recall to avoid unnecessary LLM/embedding calls. + // Reads from both the framework hook config (plugins.entries..hooks.allowPromptInjection) + // and the plugin's own config (allowPromptInjection), so users can set it in either place. const pluginEntry = (api.config as any)?.plugins?.entries?.[api.id]; - const allowPromptInjection = pluginEntry?.hooks?.allowPromptInjection !== false; + const allowPromptInjection = + pluginEntry?.hooks?.allowPromptInjection !== false && + ctx.config.allowPromptInjection !== false; if (!allowPromptInjection) { api.logger.info("memos-local: allowPromptInjection=false, auto-recall disabled"); } diff --git a/apps/memos-local-openclaw/openclaw.plugin.json b/apps/memos-local-openclaw/openclaw.plugin.json index bb828c19..bf7a6202 100644 --- a/apps/memos-local-openclaw/openclaw.plugin.json +++ b/apps/memos-local-openclaw/openclaw.plugin.json @@ -16,6 +16,10 @@ "viewerPort": { "type": "number", "description": "Memory Viewer HTTP port (default 18799)" + }, + "allowPromptInjection": { + "type": "boolean", + "description": "Set to false to disable automatic memory recall injection into prompts (default true)" } } }, diff --git a/apps/memos-local-openclaw/src/types.ts b/apps/memos-local-openclaw/src/types.ts index cb08eb1c..a8ef7c83 100644 --- a/apps/memos-local-openclaw/src/types.ts +++ b/apps/memos-local-openclaw/src/types.ts @@ -324,6 +324,8 @@ export interface MemosLocalConfig { sharing?: SharingConfig; /** Hours of inactivity after which an active task is automatically finalized. 0 = disabled. Default 4. */ taskAutoFinalizeHours?: number; + /** Set to false to disable automatic memory recall injection into prompts (default true). */ + allowPromptInjection?: boolean; } // ─── Defaults ───