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
7 changes: 4 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ interface PluginConfig {
autoRecallPerItemMaxChars?: number;
/** Hard per-turn injection cap (safety valve). Overrides autoRecallMaxItems if lower. Default: 10. */
maxRecallPerTurn?: number;
/** Maximum character length of the auto-recall query before truncation. Default: 2000. */
autoRecallMaxQueryLength?: number;
recallMode?: "full" | "summary" | "adaptive" | "off";
captureAssistant?: boolean;
retrieval?: {
Expand Down Expand Up @@ -2278,7 +2280,7 @@ const memoryLanceDBProPlugin = {

// FR-04: Truncate long prompts (e.g. file attachments) before embedding.
// Auto-recall only needs the user's intent, not full attachment text.
const MAX_RECALL_QUERY_LENGTH = 1_000;
const MAX_RECALL_QUERY_LENGTH = config.autoRecallMaxQueryLength ?? 2_000;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Wire new query-length setting into parsed config

config.autoRecallMaxQueryLength is read here, but parsePluginConfig never copies cfg.autoRecallMaxQueryLength into the returned PluginConfig, so this value is always undefined at runtime and the code always falls back to 2_000. In practice, users cannot actually configure the limit despite the commit message and inline docs saying they can.

Useful? React with 👍 / 👎.

let recallQuery = event.prompt;
if (recallQuery.length > MAX_RECALL_QUERY_LENGTH) {
const originalLength = recallQuery.length;
Expand All @@ -2305,8 +2307,6 @@ const memoryLanceDBProPlugin = {
}

const results = filterUserMdExclusiveRecallResults(await retrieveWithRetry({
query: recallQuery,
limit: retrieveLimit,
scopeFilter: accessibleScopes,
source: "auto-recall",
}), config.workspaceBoundary);
Expand Down Expand Up @@ -3818,6 +3818,7 @@ export function parsePluginConfig(value: unknown): PluginConfig {
autoRecallMaxChars: parsePositiveInt(cfg.autoRecallMaxChars) ?? 600,
autoRecallPerItemMaxChars: parsePositiveInt(cfg.autoRecallPerItemMaxChars) ?? 180,
maxRecallPerTurn: parsePositiveInt(cfg.maxRecallPerTurn) ?? 10,
autoRecallMaxQueryLength: parsePositiveInt(cfg.autoRecallMaxQueryLength) ?? 2_000,
captureAssistant: cfg.captureAssistant === true,
retrieval: typeof cfg.retrieval === "object" && cfg.retrieval !== null ? cfg.retrieval as any : undefined,
decay: typeof cfg.decay === "object" && cfg.decay !== null ? cfg.decay as any : undefined,
Expand Down
12 changes: 12 additions & 0 deletions openclaw.plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@
"default": 180,
"description": "Maximum character budget per auto-injected memory summary."
},
"autoRecallMaxQueryLength": {
"type": "integer",
"minimum": 100,
"maximum": 10000,
"default": 2000,
"description": "Maximum character length of the auto-recall query before truncation. Default: 2000."
},
"maxRecallPerTurn": {
"type": "integer",
"minimum": 1,
Expand Down Expand Up @@ -1019,6 +1026,11 @@
"help": "Maximum characters per injected memory summary.",
"advanced": true
},
"autoRecallMaxQueryLength": {
"label": "Auto-Recall Max Query Length",
"help": "Maximum character length of the auto-recall query before truncation. Default: 2000.",
"advanced": true
},
"recallMode": {
"label": "Recall Mode",
"help": "Auto-recall depth: full (default), summary (L0 only), adaptive (intent-based category routing), off.",
Expand Down
Loading