Skip to content

Passive capture writes near-duplicate knowledge #1218

Closed

Description

@sentry-junior

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.processSession captures 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#number including pull_request.merged.
  • B: PR events publish only owner/repo#number, not repo-wide owner/repo.

Verified write path

  • Each successful turn schedules scheduleSessionCompletedPluginTasks with that turn’s sessionId (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 (findExactDuplicateMemory in store.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 as existing-memories with 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

Requested by David Cramer.

--

View Junior Session [Sentry]

Activity

  1. sentry-junior commented on Nov 9, 2026

    @sentry-junior
    ContributorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions