Skip to content

fix(memory): preserve retries across replacements - #1669

Draft
dcramer wants to merge 1 commit into
codex/1600-memory-storefrom
codex/1651-memory-supersession-retry
Draft

fix(memory): preserve retries across replacements#1669
dcramer wants to merge 1 commit into
codex/1600-memory-storefrom
codex/1651-memory-supersession-retry

Conversation

@dcramer

@dcramer dcramer commented Aug 23, 2026

Copy link
Copy Markdown
Member

Memory write retries now follow the full replacement history and return the final active memory. Broken or cyclic history fails closed, so an old preference cannot be silently created again.

The existing PostgreSQL storage scenario now covers two replacements followed by a retry of the original write key. This draft is stacked on #1651 and should merge after it.

Refs #1600

@vercel

vercel Bot commented Aug 23, 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 Aug 23, 2026 8:47pm

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 d811ea5. Configure here.

return { memory: parseMemoryRow(row), outcome: "duplicate" };
}
if (row.supersededAtMs === null || row.supersededById === null) break;
id = row.supersededById;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Expiry breaks replacement chain walk

Medium Severity

The replacement walk applies the unexpired predicate to every hop, not only the final active memory. Superseded rows can keep a past expiresAtMs, so a healthy tip is never reached. Retries then hit the new fail-closed error instead of returning that active memory.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d811ea5. Configure here.

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