MemOS icon indicating copy to clipboard operation
MemOS copied to clipboard

feat: 用/memos-local-openclaw-plugin时不支持--profile出来的实例

Open Larkspur-Wang opened this issue 8 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 的,而不是一般软件问题

Problem Statement | 问题陈述

MemOS 当前的 OpenClaw 插件实现基本按默认实例 ~/.openclaw 写死了,会和 --profile 出来的openclaw 隔离策略冲突。 阻塞点是 profile 兼容性。代码中多处直接假定自己跑在默认实例:

  • README 明确要求改 ~/.openclaw/openclaw.json
  • 它读取 OpenClaw fallback 模型配置时也直接读 ~/.openclaw/openclaw.json,见 llm-call.ts:12
  • Viewer 保存配置也是写回 ~/.openclaw/openclaw.json,见 server.ts:952

这在有隔离策略实例的openclaw环境下:

  • 插件数据写到默认实例目录 ~/.openclaw/memos-local/...
  • 生成的 skills 写进 ~/.openclaw/workspace/skills/..

会破坏主实例和派生隔离实例openclaw,导致混乱。建议添加相关参数来适配openclaw --profile隔离的策略。

Willingness to Implement | 实现意愿

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

Larkspur-Wang avatar Mar 13 '26 13:03 Larkspur-Wang

PR submitted: #1264

已提交 PR:#1264。修复了 loadOpenClawFallbackConfig() 中硬编码 ~/.openclaw/openclaw.json 的问题,现在会优先使用 OPENCLAW_STATE_DIR 环境变量,使 --profile 实例正常工作。

注意:#1234 已修复了 viewer/server.ts 中同类问题,两个 PR 互补。

hijzy avatar Mar 17 '26 10:03 hijzy

Hey @Larkspur-Wang! Thanks for the contribution — already solved the issue, thanks for helping us to improve our project! 📈

Btw if you enjoyed contributing and want to stay connected with the project, we run a Discord server for contributors, a chill space to discuss features, ask questions, or pick up new issues  👉🏻 MemOS Discord Server (Contributor Exclusive)

Thanks again for shipping this, and happy MemOSing 🧠✨

angarchie avatar May 14 '26 09:05 angarchie