Skip to content

fix(memory): Deduplicate memory writes - #665

Merged
dcramer merged 2 commits into
mainfrom
codex/memory-write-dedup
Jun 29, 2026
Merged

dcramer merged 2 commits into
mainfrom
codex/memory-write-dedup

Conversation

@dcramer

@dcramer dcramer commented Jun 28, 2026

Copy link
Copy Markdown
Member

Memory writes now do a conservative duplicate check before inserting active rows in the same scope, subject, and kind. Exact normalized content and very-high vector similarity return the existing memory instead of adding another active row.

Duplicate-suppressed writes still preserve the incoming idempotency key through a hidden superseded alias row, so retries with the same key resolve to the original memory rather than creating a later duplicate. The storage spec and focused memory-store coverage were updated for that contract.

Add a conservative write-time duplicate gate for active memories in the same scope, subject, and kind. Exact normalized content and high-confidence vector matches now return the existing memory while preserving idempotent retries through a hidden alias row.

Update storage coverage and the memory storage spec for the store-owned duplicate gate.

Refs GH-658
Co-Authored-By: GPT-5 Codex <[email protected]>
@vercel

vercel Bot commented Jun 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview, Comment Jun 28, 2026 10:57pm

Request Review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1e27543. Configure here.

Comment thread packages/junior-memory/src/store.ts Resolved
Duplicate-suppressed idempotency aliases now inherit the target memory expiration instead of the duplicate candidate expiration. This keeps retries pinned to the deduped target while that target remains active.

Refs GH-658
Co-Authored-By: GPT-5 Codex <[email protected]>
@dcramer
dcramer marked this pull request as ready for review June 29, 2026 01:46
@dcramer
dcramer merged commit 91a760a into main Jun 29, 2026
16 checks passed
@dcramer
dcramer deleted the codex/memory-write-dedup branch June 29, 2026 01:47

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 55c333b2 Deployed Jun 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant