diff --git a/hindsight-integrations/openclaw/src/index.ts b/hindsight-integrations/openclaw/src/index.ts index a05a0730..a72d19c8 100644 --- a/hindsight-integrations/openclaw/src/index.ts +++ b/hindsight-integrations/openclaw/src/index.ts @@ -270,6 +270,7 @@ function getPluginConfig(api: MoltbotPluginAPI): PluginConfig { // Dynamic bank ID options (default: enabled) dynamicBankId: config.dynamicBankId !== false, bankIdPrefix: config.bankIdPrefix, + excludeProviders: Array.isArray(config.excludeProviders) ? config.excludeProviders : [], }; } @@ -549,6 +550,12 @@ export default function (api: MoltbotPluginAPI) { } currentAgentContext = ctx; + // Check if this provider is excluded + if (ctx?.messageProvider && pluginConfig.excludeProviders?.includes(ctx.messageProvider)) { + console.log(`[Hindsight] Skipping recall for excluded provider: ${ctx.messageProvider}`); + return; + } + // Derive bank ID from context const bankId = deriveBankId(ctx, pluginConfig); console.log(`[Hindsight] before_agent_start - bank: ${bankId}, channel: ${ctx?.messageProvider}/${ctx?.channelId}`); @@ -647,6 +654,12 @@ User message: ${prompt} // Use context from this hook, or fall back to context captured in before_agent_start const effectiveCtx = ctx || currentAgentContext; + // Check if this provider is excluded + if (effectiveCtx?.messageProvider && pluginConfig.excludeProviders?.includes(effectiveCtx.messageProvider)) { + console.log(`[Hindsight] Skipping retain for excluded provider: ${effectiveCtx.messageProvider}`); + return; + } + // Derive bank ID from context const bankId = deriveBankId(effectiveCtx, pluginConfig); console.log(`[Hindsight Hook] agent_end triggered - bank: ${bankId}`); diff --git a/hindsight-integrations/openclaw/src/types.ts b/hindsight-integrations/openclaw/src/types.ts index ed914361..d8d34b48 100644 --- a/hindsight-integrations/openclaw/src/types.ts +++ b/hindsight-integrations/openclaw/src/types.ts @@ -42,6 +42,7 @@ export interface PluginConfig { hindsightApiToken?: string; // API token for external Hindsight API authentication 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']) } export interface ServiceConfig {