Skip to content

fix: make feedback update similarity order-sensitive - #2544

Merged
endxxxx merged 3 commits into
MemTensor:dev-v2.0.37from
wzxsdf:codex/fix-feedback-update-similarity
Nov 18, 2026
Merged

endxxxx merged 3 commits into
MemTensor:dev-v2.0.37from
wzxsdf:codex/fix-feedback-update-similarity

Conversation

@wzxsdf

@wzxsdf wzxsdf commented Oct 25, 2026

Copy link
Copy Markdown

Description

The feedback update guard used character-set similarity to decide whether a memory update was small enough to keep.

This caused reordered multi-fact memories to be treated as minor changes because the old and new texts contained similar character sets. A destructive rewrite could therefore pass the update guard.

This change uses difflib.SequenceMatcher, which considers character order as well as content. A regression test covers reordered text with the same facts.

Related Issue: #2527

No new dependencies are required.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality not to work as expected)
  • Refactor (does not change functionality, e.g. code style improvements)
  • Documentation update

How Has This Been Tested?

  • Unit Test
  • Test Script Or Test Steps
  • Pipeline Automated API Test

Validation performed:

  • poetry run pytest tests/mem_feedback -q — 21 passed
  • Ruff check passed
  • Ruff format check passed

Checklist

  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective
  • I have linked the issue to this PR
  • I have mentioned the person who will review this PR

Reviewer Checklist

@Memtensor-AI Memtensor-AI added area:memory 记忆存储、检索、更新、召回逻辑 status:in-progress Someone or AI is working on it | 人工或 AI 正在处理 labels Oct 25, 2026
@Memtensor-AI

Memtensor-AI commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

🤖 Open Code Review

Target: PR #2544
Task: 9753a0dacd5a0884
Base: main
Head: codex/fix-feedback-update-similarity
Head SHA: ad3d1176161425794eec4785fa7f045441769e28

✅ OpenCodeReview: Review complete: 0 finding(s) across 1 selected item(s).

Generated by cloud-assistant via Open Code Review.

@Memtensor-AI

Copy link
Copy Markdown
Collaborator

✅ Automated Test Results: PASSED

All tests passed (11/11 executed). memos_python_core/changed-repo-python: 11/11. Duration: 18s

Branch: codex/fix-feedback-update-similarity

@Memtensor-AI Memtensor-AI added status:ready Ready for implementation; waiting for assignee or AI dispatch | 可进入实现,等待认领或派发 and removed status:in-progress Someone or AI is working on it | 人工或 AI 正在处理 labels Oct 26, 2026
@Memtensor-AI Memtensor-AI added status:in-progress Someone or AI is working on it | 人工或 AI 正在处理 and removed status:ready Ready for implementation; waiting for assignee or AI dispatch | 可进入实现,等待认领或派发 labels Nov 18, 2026
@Memtensor-AI Memtensor-AI added status:ready Ready for implementation; waiting for assignee or AI dispatch | 可进入实现,等待认领或派发 and removed status:in-progress Someone or AI is working on it | 人工或 AI 正在处理 labels Nov 18, 2026
@endxxxx
endxxxx changed the base branch from main to dev-v2.0.37 November 18, 2026 07:04
@endxxxx
endxxxx merged commit d613313 into MemTensor:dev-v2.0.37 Nov 18, 2026
13 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:memory 记忆存储、检索、更新、召回逻辑 status:ready Ready for implementation; waiting for assignee or AI dispatch | 可进入实现,等待认领或派发

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Correcting or restoring one fact in a multi-fact memory rewrites the entire memory text

5 participants