Skip to content

Commit f96d4de

Browse files
committed
fix: Phase 1 - createMockApi accepts pluginConfigOverrides param + remove dead isExplicitRememberCommand guard (PR CortexReach#518 review fixes)
1 parent 3176106 commit f96d4de

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

index.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2746,18 +2746,10 @@ const memoryLanceDBProPlugin = {
27462746

27472747
const priorRecentTexts = autoCaptureRecentTexts.get(sessionKey) || [];
27482748
let texts = newTexts;
2749-
// [Fix #5] isExplicitRememberCommand: guard against empty pendingIngressTexts
2750-
const lastPending = pendingIngressTexts.length > 0
2751-
? pendingIngressTexts[pendingIngressTexts.length - 1]
2752-
: (eligibleTexts.length === 1 ? eligibleTexts[0] : null);
2753-
if (
2754-
texts.length === 1 &&
2755-
lastPending !== null &&
2756-
isExplicitRememberCommand(lastPending) &&
2757-
priorRecentTexts.length > 0
2758-
) {
2759-
texts = [...pendingIngressTexts, ...priorRecentTexts.slice(-1), ...eligibleTexts];
2760-
}
2749+
// [Fix #5 REMOVED] isExplicitRememberCommand guard: unreachable under REPLACE strategy.
2750+
// With REPLACE, texts = pendingIngressTexts (length typically > 1 in multi-turn),
2751+
// so texts.length === 1 guard can never trigger.
2752+
// This guard was designed for the old APPEND strategy and is obsolete.
27612753
if (newTexts.length > 0) {
27622754
const nextRecentTexts = [...priorRecentTexts, ...newTexts].slice(-6);
27632755
autoCaptureRecentTexts.set(sessionKey, nextRecentTexts);

test/smart-extractor-branches.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,15 @@ function createEmbeddingServer() {
6464
});
6565
}
6666

67-
function createMockApi(dbPath, embeddingBaseURL, llmBaseURL, logs) {
67+
function createMockApi(dbPath, embeddingBaseURL, llmBaseURL, logs, pluginConfigOverrides = {}) {
6868
return {
6969
pluginConfig: {
7070
dbPath,
7171
autoCapture: true,
7272
autoRecall: false,
7373
smartExtraction: true,
7474
extractMinMessages: 2,
75+
...pluginConfigOverrides,
7576
embedding: {
7677
apiKey: "dummy",
7778
model: "qwen3-embedding-4b",

0 commit comments

Comments
 (0)