Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion apps/memos-local-openclaw/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.<id>.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");
}
Expand Down
4 changes: 4 additions & 0 deletions apps/memos-local-openclaw/openclaw.plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
}
}
},
Expand Down
2 changes: 2 additions & 0 deletions apps/memos-local-openclaw/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ───
Expand Down