Repository navigation
Closed
Description
Multi-turn public threads store near-duplicate conversation knowledge/procedure memories across successive completed turns. Same durable fact, different wording, both stay active.
Observed
- Conversation investigated an event-task match miss across three successive turns.
- Two post-turn
memory.processSessioncaptures both wrote overlapping facts:- Turn A capture wrote 4 memories (matching rule, PR identifier shape, repo-only PR miss, investigation procedure).
- Turn B capture (~80s later, after A finished) wrote 4 more: rephrased matching rule, rephrased PR-only identifier fact, plus issue dual-publish and repository resource-type notes.
- Third turn captured nothing new.
- Second job is not a race with the first: A completed before B started, and both batches remain active.
Example near-duplicates (paraphrased)
- A: event-task matching is exact on teamId + namespace + identifier, then event type.
- B: matching requires team, namespace, exact identifier, and event type; not event-type-only.
- A: PR events use
owner/repo#numberincludingpull_request.merged. - B: PR events publish only
owner/repo#number, not repo-wideowner/repo.
Verified write path
- Each successful turn schedules
scheduleSessionCompletedPluginTaskswith that turn’ssessionId(packages/junior/src/chat/runtime/reply-executor.ts,task-runner.ts). - Memory owns
processSession→processMemorySession(packages/junior-memory/src/plugin.ts,process-session.ts). - Idempotency key is per session + kind + exact content hash (
session:${sourceKey}:${sessionId}:${suffix}), so rephrasing bypasses retry dedupe. - Write-time hard gate for all kinds is exact normalized content only (
findExactDuplicateMemoryinstore.ts). - Semantic preference adjudication (duplicate / supersede) runs only for personal
preference(createScopedMemory); knowledge/procedure have no equivalent write-time gate. - Soft skip is extraction-only: top-10
searchMemories(evidenceText)passed asexisting-memorieswith an LLM “skip if already covered” instruction (process-session.ts,agent.ts). No post-extraction cosine/adjudication gate. - Session transcript includes prior public user messages as context authority plus the completed run (
loadPluginRun/loadConversationContextTranscriptEntries), so later turns re-see earlier investigation evidence and can re-extract it under new phrasing.
Impact
- Conversation memory accumulates redundant facts on ordinary multi-turn investigations.
- Recall and list surfaces get noisier; storage/cost grow with thread length rather than distinct facts.
Related
- Broader lifecycle tracking: Keep Memory useful, current, and safe as it grows #658 (semantic dedup called out; preference supersession landed in feat(memory): Add preference supersession #670 / fix(memory): Reuse semantic preference duplicates #973).
- This report is the concrete multi-turn passive-capture failure mode for knowledge/procedure.
Requested by David Cramer.
--
Metadata
Metadata
Assignees
Labels
No labels
Activity
sentry-junior commentedon Nov 9, 2026
Fixed on main by #2110: passive capture runs a semantic duplicate review for every memory kind.
Closed during a tracker cleanup. Reopen if something here is still missing.