MemOS icon indicating copy to clipboard operation
MemOS copied to clipboard

fix: dont create skill everytime

Open hijzy opened this issue 6 months ago • 2 comments

Pre-submission checklist | 提交前检查

  • [x] I have searched existing issues and this hasn't been mentioned before | 我已搜索现有问题,确认此问题尚未被提及
  • [x] I have read the project documentation and confirmed this issue doesn't already exist | 我已阅读项目文档并确认此问题尚未存在
  • [x] This issue is specific to MemOS and not a general software issue | 该问题是针对 MemOS 的,而不是一般软件问题

Bug Description | 问题描述

Don't create skill everytime

How to Reproduce | 如何重现

memory add

Environment | 环境信息

python3.13

Additional Context | 其他信息

No response

Willingness to Implement | 实现意愿

  • [ ] I'm willing to implement this myself | 我愿意自己解决
  • [x] I would like someone else to implement this | 我希望其他人来解决

hijzy avatar May 20 '26 04:05 hijzy

This issue has been automatically marked as stale due to inactivity.

github-actions[bot] avatar Jul 03 '26 03:07 github-actions[bot]

Resolved by #1770 (commit 16eeaa4c), merged on 2026-05-20 — the same day this issue was filed.

Cause / 原因: process_skill_memory_fine triggered SkillMemory extraction on every add, even for ordinary conversations with little or no tool usage. / 之前每次 add 都会抽取技能记忆,即便对话中几乎没有工具调用。

Fix / 修复: skill extraction is now skipped when the conversation contains fewer than 5 tool-role messages, so a normal memory add no longer creates a skill (SkillMemory is meant to be distilled from multi-round tool-using tasks). / 现在当对话中 role=="tool" 的消息少于 5 条时跳过抽取,普通 memory add 不再创建技能记忆(技能记忆本应从多轮工具调用任务中提炼)。

tool_rounds = sum(1 for message in messages if message.get("role") == "tool")
if tool_rounds < 5:
    logger.info(f"[PROCESS_SKILLS] Skip skill extraction: tool rounds {tool_rounds} < 5")
    return []

The fix is live on main (src/memos/mem_reader/read_skill_memory/process_skill_memory.py). This issue stayed open only because the PR was merged into a dev branch, so GitHub never auto-closed it. Closing as completed. / 修复已在 main 生效;本 Issue 未自动关闭是因为 PR 当时合入的是 dev 分支。现关闭。

shinetata avatar Jul 16 '26 07:07 shinetata