Fix #1527: [Bug] suggestion_handler sends system-only message — fails on MiniMax & Anthropi#1868
Open
Memtensor-AI wants to merge 12 commits into
Open
Fix #1527: [Bug] suggestion_handler sends system-only message — fails on MiniMax & Anthropi#1868Memtensor-AI wants to merge 12 commits into
Memtensor-AI wants to merge 12 commits into
Conversation
## Summary - add an OpenClaw runtime lock to block duplicate plugin instances before tools/hooks register - fail startup on viewer port conflicts and clean up partial runtime state - keep lightweight local memories searchable/listable without an LLM final filter, while preserving full-mode self-evolution boundaries - cover runtime locking, duplicate startup, lightweight retrieval, delayed agent_end recovery, and partial migration behavior ## Tests - npm test -- --run tests/unit - npm run lint - npm run build - git diff --check --cached
#1807) Automated PR from mem-agent-0520-niu to mem-agent-0520.
* docs: translate openai_memory_locomo_eval_guide to Chinese * docs: translate evaluation overview to Chinese
* fix(mcp): handle empty filter dict in search_memories tool
MCP clients such as Cherry Studio always pass filter:{} in conversation
mode. FastMCP rejects unknown or invalid parameters, returning HTTP 400
"Invalid request parameters". Accept the filter parameter and normalise
an empty dict to None so the call succeeds.
Fixes #1718
* docs: translate core API reference docs to English (#1693)
* fix: resolve ruff lint/format issues in test_mcp_serve.py
* fix(mcp): handle empty filter dict in search_memories tool
MCP clients such as Cherry Studio always pass filter:{} in conversation
mode. FastMCP rejects unknown or invalid parameters, returning HTTP 400
"Invalid request parameters". Accept the filter parameter and normalise
an empty dict to None so the call succeeds.
Fixes #1718
* docs: translate module docs to Chinese (#1691)
* fix: resolve ruff lint/format issues in test_mcp_serve.py
---------
Co-authored-by: Jiang <33757498+hijzy@users.noreply.github.com>
## Description Please include a summary of the change, the problem it solves, the implementation approach, and relevant context. List any dependencies required for this change. Related Issue (Required): Fixes #issue_number ## 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? Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration - [ ] 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](https://github.com/MemTensor/MemOS-Docs) (if applicable) | 我已在 [MemOS-Docs](https://github.com/MemTensor/MemOS-Docs) 中创建了相关的文档 issue/PR(如果适用) - [ ] I have linked the issue to this PR (if applicable) | 我已将 issue 链接到此 PR(如果适用) - [ ] I have mentioned the person who will review this PR | 我已提及将审查此 PR 的人 ## Reviewer Checklist - [ ] closes #xxxx (Replace xxxx with the GitHub issue number) - [ ] Made sure Checks passed - [ ] Tests have been provided
## Description Please include a summary of the change, the problem it solves, the implementation approach, and relevant context. List any dependencies required for this change. Related Issue (Required): Fixes #issue_number ## 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? Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration - [ ] 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](https://github.com/MemTensor/MemOS-Docs) (if applicable) | 我已在 [MemOS-Docs](https://github.com/MemTensor/MemOS-Docs) 中创建了相关的文档 issue/PR(如果适用) - [ ] I have linked the issue to this PR (if applicable) | 我已将 issue 链接到此 PR(如果适用) - [ ] I have mentioned the person who will review this PR | 我已提及将审查此 PR 的人 ## Reviewer Checklist - [ ] closes #xxxx (Replace xxxx with the GitHub issue number) - [ ] Made sure Checks passed - [ ] Tests have been provided
…c compatibility Fixes #1527 Changes: - suggestion_handler.py: Split system-only messages in _get_further_suggestion() and handle_get_suggestion_queries() - chat_handler.py: Split system-only message in _get_further_suggestion_queries() - Added test coverage in test_suggestion_handler.py All modified functions now use [system, user] message structure instead of system-only, ensuring compatibility with MiniMax and Anthropic APIs while maintaining OpenAI compatibility.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
已修复 Issue #1527:suggestion_handler 和 chat_handler 中 3 处 system-only 消息调用现已拆分为 system + user 结构,确保 MiniMax 和 Anthropic API 兼容性。
修改文件:
src/memos/api/handlers/suggestion_handler.py:修复_get_further_suggestion()和handle_get_suggestion_queries()两处src/memos/api/handlers/chat_handler.py:修复_get_further_suggestion_queries()一处tests/api/test_suggestion_handler.py:新增测试覆盖消息结构验证验证结果:
风险评估:低风险,局部修改,无 API 合约变更,无数据库迁移,向后兼容。
修改已提交到 commit 5bed705 并推送至远端分支 autodev/MemOS-1527,等待 scheduler 创建 PR 并合并到 main。
Related Issue (Required): Fixes #1527
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Executor did not report tests.
Checklist
@MatthewZhuang, @CarltonXiang, @syzsunshine219 please review this PR.
Reviewer Checklist