Skip to content

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

Open
syzsunshine219 wants to merge 2 commits into
MemTensor:mainfrom
Memtensor-AI:bugfix/autodev-2469-20261008201723155
Open

syzsunshine219 wants to merge 2 commits into
MemTensor:mainfrom
Memtensor-AI:bugfix/autodev-2469-20261008201723155

Conversation

@syzsunshine219

@syzsunshine219 syzsunshine219 commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Restores the change proposed in #2471 for review against main after its former base branch, dev-v2.0.36, was deleted. The source commits and authors are preserved.

Source head: 7818adfd88585d2d4984661b4ce6dcd0e7ad7347

This PR is open for review. Review and CI against the current base are pending; validation claims in the original description below refer to the earlier snapshot. The original discussion and evidence remain in #2471.


Original change description

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

autodev added 2 commits October 9, 2026 04:26
…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.
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.
@syzsunshine219
syzsunshine219 marked this pull request as ready for review November 9, 2026 15:48
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.

[Bug] memos-local-plugin: capture summarizer writes Chinese summaries for English conversations (prompt's language rule + 用户说了 example)

1 participant