Skip to content
Open
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
14 changes: 13 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2002,8 +2002,20 @@ const memoryLanceDBProPlugin = {
const agentId = resolveHookAgentId(ctx?.agentId, (event as any).sessionKey);
const accessibleScopes = scopeManager.getAccessibleScopes(agentId);

// 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 = 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;
recallQuery = recallQuery.slice(0, MAX_RECALL_QUERY_LENGTH);
api.logger.info(
`memory-lancedb-pro: auto-recall query truncated from ${originalLength} to ${MAX_RECALL_QUERY_LENGTH} chars`
);
}

const results = await retrieveWithRetry({
query: event.prompt,
query: recallQuery,
limit: 3,
scopeFilter: accessibleScopes,
source: "auto-recall",
Expand Down