Skip to content

Fix #2469: [Bug] memos-local-plugin: capture summarizer writes Chinese summaries for Englis - #2471

Open
Memtensor-AI wants to merge 2 commits into
MemTensor:dev-v2.0.36from
Memtensor-AI:bugfix/autodev-2469-20261008201723155
Open

Memtensor-AI wants to merge 2 commits into
MemTensor:dev-v2.0.36from
Memtensor-AI:bugfix/autodev-2469-20261008201723155

Conversation

@Memtensor-AI

Copy link
Copy Markdown
Collaborator

Description

Fixed issue #2469: the memos-local-plugin capture summarizer was emitting Chinese summaries for English conversations on some models (e.g. openai/gpt-6-luna at temp 0, measured ~89% CJK on tool-call summaries and ~66% on conversational summaries). Root cause: the SYSTEM_PROMPT in apps/memos-local-plugin/core/capture/summarizer.ts anchored its language rule on an ambiguous referent ("in the user's original language") and carried a lone CJK example ("用户说了") that primed models toward Chinese under the 100-character cap. gemini-2.5-flash-lite was 0/750, confirming the leak only triggered on certain models.

Applied the reporter-validated diff: replaced the language rule with "written in the same language as the USER text (English text gets an English summary)" and removed the Chinese example from the "Do NOT prefix" rule. Added a regression unit test at tests/unit/capture/summarizer-prompt.test.ts that spies on the system message the summarizer sends and asserts (a) no Han characters leak into the prompt and (b) the USER-text anchoring is preserved — guarding both failure modes against future drift.

Verification: ran the regression tests against the pre-fix prompt first (both failed as expected per TDD), then applied the fix and re-ran. Full plugin unit suite is green — 182 test files / 1592 passed / 1 skipped. TypeScript check (tsc --noEmit -p tsconfig.json) exits 0. Committed on bugfix/autodev-2469-20261008201723155 and pushed to origin; opsp task file archived to the sibling specs repo.

Related Issue (Required): Fixes #2469

Type of change

Please delete options that are not relevant.

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

How Has This Been Tested?

Automated tests are pending.

  • Unit Test
  • Test Script Or Test Steps (please provide)
  • Pipeline Automated API Test (please provide)

Checklist

  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have created related documentation issue/PR in MemOS-Docs (if applicable)
  • I have linked the issue to this PR (if applicable)
  • I have mentioned the person who will review this PR

@whipser030, @hijzy please review this PR.

Reviewer Checklist

…Tensor#2469)

The capture SYSTEM_PROMPT anchored its language rule on an ambiguous
referent ("the user's original language") and carried a lone CJK example
("用户说了") that primed some models (observed with openai/gpt-6-luna
at temp 0) to emit Chinese summaries for English conversations — up to
89% CJK on tool-call summaries and 66% on conversational summaries.

Fix per issue MemTensor#2469 (reporter-validated on the same model, 0/30 CJK on
English inputs after the change):

- Replace "in the user's original language" with "written in the same
  language as the USER text (English text gets an English summary)".
- Remove the Chinese example from the "Do NOT prefix" rule, keeping
  only "The user said".

Also adds a regression unit test that spies on the system message sent
to the LLM and asserts the Chinese example is gone and the language
rule is anchored on the USER text.
@Memtensor-AI

Memtensor-AI commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator Author

🤖 Open Code Review

Target: PR #2471
Task: d4c48f981934baef
Base: dev-v2.0.36
Head: bugfix/autodev-2469-20261008201723155
Head SHA: 7818adfd88585d2d4984661b4ce6dcd0e7ad7347

✅ 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 Author

🔧 Open Code Review requested Agent fix

Open Code Review found 2 issue(s). I have resumed the development Agent to fix them.

  • Task: d4c48f981934baef
  • Fix attempt: 1/2
  • Finding delta: 0 repeated / 2 new / 0 likely resolved

The Agent will push a new commit to this PR branch. OCR will recheck after the commit is pushed.

Address OCR findings on PR MemTensor#2471 without reintroducing the CJK anchor
that originally caused issue MemTensor#2469.

OCR finding 1 (summarizer.ts L106-L107): the single English example
("English text gets an English summary") may still anchor the model
to English for non-English conversations. Add a French worked example
and spell out that the rule applies to every other language.

OCR finding 2 (summarizer.ts L110): the English-only "Do NOT prefix
with 'The user said'" rule may let the model prepend an equivalent
opener in a non-English conversation (e.g. a Chinese "用户说了…").
Rather than re-adding the specific CJK anchor — issue MemTensor#2469 proved
that a lone "用户说了" example drove 89% CJK output on tool-call
summaries with openai/gpt-6-luna, which the removal fixed to 0/30 —
make the rule explicitly language-agnostic ("the equivalent 'the user
said…' opener in any other language"). That covers Chinese, Japanese,
Korean, French, etc. without priming any one of them.

Extend the regression test with two new cases: one asserts the
positive rule carries both English and French worked examples, the
other asserts the negative-prefix rule reaches beyond English via an
"any other language" clause. The two original guards (no "用户说了",
no Han characters at all) still hold.
@Memtensor-AI

Copy link
Copy Markdown
Collaborator Author

❌ Automated Test Results: FAILED

Auto-fix retry 1/2 triggered.

Error details
All test phases passed (1 passed in smoke, 12 passed in changed-repo-python, both exit 0) with no failed cases to analyze. [advisory, non-gating] AI-generated tests on branch test/auto-gen-d4c48f981934baef-20261009043330: 92/102 passed — these do NOT affect the PR verdict; review the branch manually.

Branch: bugfix/autodev-2469-20261008201723155

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

Labels

ai:generated Generated or modified by AI | 由 AI 生成或修改 area:plugin OpenClaw & Hermes status:in-progress Someone or AI is working on it | 人工或 AI 正在处理

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants