Skip to content

Commit d20a0e6

Browse files
committed
fix: resolve all Must Fix items from PR CortexReach#534 review (issue CortexReach#417)
1 parent 6a3a864 commit d20a0e6

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2652,6 +2652,7 @@ const memoryLanceDBProPlugin = {
26522652
// event-scoped; (3) APPEND causes deduplication issues when the same text
26532653
// appears in both pendingIngressTexts and eligibleTexts (after prefix stripping).
26542654
newTexts = pendingIngressTexts;
2655+
autoCapturePendingIngressTexts.delete(conversationKey); // [Fix #8] Clear consumed pending texts to prevent re-consumption
26552656
} else if (previousSeenCount > 0 && eligibleTexts.length > previousSeenCount) {
26562657
newTexts = eligibleTexts.slice(previousSeenCount);
26572658
}
@@ -2757,6 +2758,7 @@ const memoryLanceDBProPlugin = {
27572758
);
27582759
// Charge rate limiter only after successful extraction
27592760
extractionRateLimiter.recordExtraction();
2761+
autoCaptureSeenTextCount.set(sessionKey, 0); // [Fix #8] Reset after extraction to avoid re-triggering on every subsequent agent_end
27602762
if (stats.created > 0 || stats.merged > 0) {
27612763
api.logger.info(
27622764
`memory-lancedb-pro: smart-extracted ${stats.created} created, ${stats.merged} merged, ${stats.skipped} skipped for agent ${agentId}`

test/smart-extractor-branches.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ function createMockApi(dbPath, embeddingBaseURL, llmBaseURL, logs, pluginConfigO
7373
smartExtraction: true,
7474
extractMinMessages: 2,
7575
...pluginConfigOverrides,
76+
// Note: embedding always wins over pluginConfigOverrides — this is intentional
77+
// so tests get deterministic mock embeddings regardless of overrides.
7678
embedding: {
7779
apiKey: "dummy",
7880
model: "qwen3-embedding-4b",

0 commit comments

Comments
 (0)