From 3f9eb27cd741155d327bc9ae3293efc9b0a1c745 Mon Sep 17 00:00:00 2001 From: Anton Evseev <78427278+slayoffer@users.noreply.github.com> Date: Fri, 20 Feb 2026 18:31:46 +1000 Subject: [PATCH] feat(openclaw): add autoRecall toggle and excludeProviders schema (#413) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add `autoRecall` config option (default: true) to allow disabling automatic memory recall injection when the host agent has its own dedicated recall tool. This is backward compatible — existing deployments continue auto-recalling as before. Also add the existing `excludeProviders` field to the plugin.json configSchema so it appears in the UI and docs. Co-authored-by: Claude Opus 4.6 --- .../openclaw/openclaw.plugin.json | 18 ++++++++++++++++++ hindsight-integrations/openclaw/src/index.ts | 7 +++++++ hindsight-integrations/openclaw/src/types.ts | 1 + 3 files changed, 26 insertions(+) diff --git a/hindsight-integrations/openclaw/openclaw.plugin.json b/hindsight-integrations/openclaw/openclaw.plugin.json index b3036995..7e2875b7 100644 --- a/hindsight-integrations/openclaw/openclaw.plugin.json +++ b/hindsight-integrations/openclaw/openclaw.plugin.json @@ -63,6 +63,16 @@ "bankIdPrefix": { "type": "string", "description": "Optional prefix for bank IDs (e.g., 'prod' results in 'prod-slack-U123'). Useful for separating environments." + }, + "autoRecall": { + "type": "boolean", + "description": "Automatically recall memories on every prompt and inject them as context. Set to false when agent has its own recall tool.", + "default": true + }, + "excludeProviders": { + "type": "array", + "items": { "type": "string" }, + "description": "Message providers to exclude from recall and retain (e.g. ['telegram', 'discord'])" } }, "additionalProperties": false @@ -119,6 +129,14 @@ "bankIdPrefix": { "label": "Bank ID Prefix", "placeholder": "e.g., prod, staging (optional)" + }, + "autoRecall": { + "label": "Auto-Recall", + "placeholder": "true (inject memories on every prompt)" + }, + "excludeProviders": { + "label": "Excluded Providers", + "placeholder": "e.g. telegram, discord" } } } diff --git a/hindsight-integrations/openclaw/src/index.ts b/hindsight-integrations/openclaw/src/index.ts index fe0f5bcf..588487ba 100644 --- a/hindsight-integrations/openclaw/src/index.ts +++ b/hindsight-integrations/openclaw/src/index.ts @@ -440,6 +440,7 @@ function getPluginConfig(api: MoltbotPluginAPI): PluginConfig { dynamicBankId: config.dynamicBankId !== false, bankIdPrefix: config.bankIdPrefix, excludeProviders: Array.isArray(config.excludeProviders) ? config.excludeProviders : [], + autoRecall: config.autoRecall !== false, // Default: true (on) — backward compatible }; } @@ -726,6 +727,12 @@ export default function (api: MoltbotPluginAPI) { return; } + // Skip auto-recall when disabled (agent has its own recall tool) + if (!pluginConfig.autoRecall) { + console.log('[Hindsight] Auto-recall disabled via config, skipping'); + return; + } + // Derive bank ID from context const bankId = deriveBankId(ctx, pluginConfig); console.log(`[Hindsight] before_agent_start - bank: ${bankId}, channel: ${ctx?.messageProvider}/${ctx?.channelId}`); diff --git a/hindsight-integrations/openclaw/src/types.ts b/hindsight-integrations/openclaw/src/types.ts index d6015d19..3c9f43ea 100644 --- a/hindsight-integrations/openclaw/src/types.ts +++ b/hindsight-integrations/openclaw/src/types.ts @@ -43,6 +43,7 @@ export interface PluginConfig { dynamicBankId?: boolean; // Enable per-channel memory banks (default: true) bankIdPrefix?: string; // Prefix for bank IDs (e.g. 'prod' -> 'prod-slack-C123') excludeProviders?: string[]; // Message providers to exclude from recall/retain (e.g. ['telegram', 'discord']) + autoRecall?: boolean; // Auto-recall memories on every prompt (default: true). Set to false when agent has its own recall tool. } export interface ServiceConfig {