Skip to content

Commit 5ade2d2

Browse files
committed
fix: resolve all Must Fix items from PR CortexReach#534 review (issue CortexReach#417)
1 parent 7f83529 commit 5ade2d2

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
@@ -2674,6 +2674,7 @@ const memoryLanceDBProPlugin = {
26742674
// event-scoped; (3) APPEND causes deduplication issues when the same text
26752675
// appears in both pendingIngressTexts and eligibleTexts (after prefix stripping).
26762676
newTexts = pendingIngressTexts;
2677+
autoCapturePendingIngressTexts.delete(conversationKey); // [Fix #8] Clear consumed pending texts to prevent re-consumption
26772678
} else if (previousSeenCount > 0 && eligibleTexts.length > previousSeenCount) {
26782679
newTexts = eligibleTexts.slice(previousSeenCount);
26792680
}
@@ -2779,6 +2780,7 @@ const memoryLanceDBProPlugin = {
27792780
);
27802781
// Charge rate limiter only after successful extraction
27812782
extractionRateLimiter.recordExtraction();
2783+
autoCaptureSeenTextCount.set(sessionKey, 0); // [Fix #8] Reset after extraction to avoid re-triggering on every subsequent agent_end
27822784
if (stats.created > 0 || stats.merged > 0) {
27832785
api.logger.info(
27842786
`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)