feat(openclaw): add autoRecall toggle and excludeProviders schema (#413)
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 <noreply@anthropic.com>
This commit is contained in:
parent
13c82bab60
commit
3f9eb27cd7
3 changed files with 26 additions and 0 deletions
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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}`);
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue