Skip to content

Fix #1398: [Bug] autoInstall: false 不生效,install_recommended 路径绕过了配置#1861

Open
Memtensor-AI wants to merge 6 commits into
dev-20260604-v2.0.19from
autodev/MemOS-1398
Open

Fix #1398: [Bug] autoInstall: false 不生效,install_recommended 路径绕过了配置#1861
Memtensor-AI wants to merge 6 commits into
dev-20260604-v2.0.19from
autodev/MemOS-1398

Conversation

@Memtensor-AI
Copy link
Copy Markdown
Collaborator

Description

修复 autoInstall: false 配置不生效的问题。

问题根因:evolver.ts 的 autoInstallIfNeeded 方法存在两个独立的自动安装路径,第二个路径(install_recommended)完全绕过了 autoInstall 配置检查。

修复方案

  • 统一在方法开头检查 autoInstall 配置
  • 当 autoInstall: false 时,直接返回,阻止所有自动安装路径
  • 保留远程分支的改进(添加 debug 日志和详细的安装信息)
  • 新增单元测试验证修复效果

变更文件

  • apps/memos-local-openclaw/src/skill/evolver.ts(核心修复)
  • apps/memos-local-openclaw/src/skill/tests/evolver.test.ts(新增测试)

修复后,autoInstall: false 配置将正确禁止所有自动安装行为,包括 install_recommended 路径。

Related Issue (Required): Fixes #1398

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?

Executor did not report tests.

  • 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) | 我已在 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 的人

@MatthewZhuang, @CarltonXiang, @syzsunshine219 please review this PR.

Reviewer Checklist

jiachengzhen and others added 4 commits May 27, 2026 20:10
When skillEvolution.autoInstall is set to false, the install_recommended
path in autoInstallIfNeeded() was still triggering automatic installation.
This fix ensures autoInstall=false completely disables all auto-install
behavior.

Closes #1398

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: harvey_xiang <harvey_xiang22@163.com>
- Remove install_recommended bypass that ignored autoInstall config
- Consolidate logic: check autoInstall once at method entry
- Add unit tests verifying autoInstall: false blocks all installations

Fixes #1398
MemOS AutoDev and others added 2 commits June 2, 2026 16:37
- Fix autoInstallIfNeeded to skip ALL auto-installation when autoInstall=false
- Previously install_recommended path bypassed autoInstall config check
- Add comprehensive test coverage for autoInstall behavior (false/true/default)
- Closes #1398
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.

4 participants