You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: Title: memos-local-openclaw-plugin corrupts openclaw.json by inserting "group:plugins" into models[*].input #1377
I have searched existing issues and this hasn't been mentioned before | 我已搜索现有问题,确认此问题尚未被提及
I have read the project documentation and confirmed this issue doesn't already exist | 我已阅读项目文档并确认此问题尚未存在
This issue is specific to MemOS and not a general software issue | 该问题是针对 MemOS 的,而不是一般软件问题
Bug Description | 问题描述
What happened:
After installing/enabling the memos-local plugin, startup logs show:
memos-local: added 'group:plugins' to tools.allow in openclaw.json
But instead of being added to tools.allow, the config becomes corrupted and "group:plugins" is inserted into:
models.providers.xxxxxx.models.0.input
Example broken config:
"input": ["text", "image", "group:plugins"]
Validation error:
models.providers.xxxxxx.models.0.input.2: Invalid input (allowed: "text", "image")
Expected:
"group:plugins" should only be added under tools.allow, or not written automatically at all.
Actual:
The plugin writes/merges config into the wrong path, corrupting model config.
How to Reproduce | 如何重现
Start from a valid ~/.openclaw/openclaw.json that contains a provider model config like:
Restart OpenClaw gateway or start OpenClaw so the plugin initializes.
Check the logs
Observe that the plugin logs
Then inspect ~/.openclaw/openclaw.json
In my case, instead of only updating tools.allow, the config became corrupted and "group:plugins" was inserted into:models.providers.xxxxx.models[0].input
Summary: Fixes #1377: the memos-local-openclaw plugin was corrupting ~/.openclaw/openclaw.json by writing "group:plugins" into models.providers..models[].input instead of tools.allow.
Root cause: the original implementation in apps/memos-local-openclaw/index.ts used a non-global String.replace against the raw JSON text. The regex looked for the JSON literal of the last tools.allow entry followed by ]. Because models.providers..models[].input appears before tools.allow in the default OpenClaw layout, and the input array often ends with the same literal (e.g. "image") as the last tools.allow entry, the first match landed inside the wrong array. The literal was also fed to RegExp without escaping regex metacharacters.
Fix: extracted a small pure helper ensureToolsAllowEntry(raw, entry) in apps/memos-local-openclaw/src/openclaw-config.ts that parses the JSON, appends the entry to tools.allow only, and re-serialises while preserving the original indent and trailing newline. The helper is a no-op when the entry is already present, when tools.allow contains "*", when tools.allow is missing/empty, or when the input cannot be parsed. index.ts now calls the helper instead of running the textual patch.
Tests: added tests/openclaw-config.test.ts with 8 cases, including a direct regression reproducing the exact input/allow shape from the issue. Verified locally: vitest run on the new test plus 5 neighbouring suites — 35/35 passed in 8.96s; tsc --noEmit clean. Pushed bugfix/autodev-1377 to origin; opsp specs archived to memos-autodev-specs#main (commit ca26b01). Scheduler should now open the PR against dev-20260624-v2.0.22.
Activity
fix(plugin): anchor tools.allow patch to its own array; escape regex;…
Memtensor-AI commentedon Jun 30, 2026
🤖 AutoDev has picked up this issue and started working on it.
Task ID:
57250d8598d12340Working branch:
bugfix/autodev-1377Target branch:
latest dev* branchWorkflow: opsp (analysis → coding → testing → PR)
I will post the PR link here once done. If I need more information, I will ask in the comments.
fix(memos-local-openclaw): prevent openclaw.json corruption when addi…
Memtensor-AI commentedon Jun 30, 2026
✅ AutoDev task
57250d8598d12340completed.Summary: Fixes #1377: the memos-local-openclaw plugin was corrupting ~/.openclaw/openclaw.json by writing "group:plugins" into models.providers..models[].input instead of tools.allow.
Root cause: the original implementation in apps/memos-local-openclaw/index.ts used a non-global String.replace against the raw JSON text. The regex looked for the JSON literal of the last tools.allow entry followed by
]. Because models.providers..models[].input appears before tools.allow in the default OpenClaw layout, and the input array often ends with the same literal (e.g. "image") as the last tools.allow entry, the first match landed inside the wrong array. The literal was also fed to RegExp without escaping regex metacharacters.Fix: extracted a small pure helper
ensureToolsAllowEntry(raw, entry)in apps/memos-local-openclaw/src/openclaw-config.ts that parses the JSON, appends the entry to tools.allow only, and re-serialises while preserving the original indent and trailing newline. The helper is a no-op when the entry is already present, when tools.allow contains "*", when tools.allow is missing/empty, or when the input cannot be parsed. index.ts now calls the helper instead of running the textual patch.Tests: added tests/openclaw-config.test.ts with 8 cases, including a direct regression reproducing the exact input/allow shape from the issue. Verified locally:
vitest runon the new test plus 5 neighbouring suites — 35/35 passed in 8.96s;tsc --noEmitclean. Pushed bugfix/autodev-1377 to origin; opsp specs archived to memos-autodev-specs#main (commit ca26b01). Scheduler should now open the PR against dev-20260624-v2.0.22.Base branch:
mainBranch:
bugfix/autodev-1377Commit:
cae4e4aPR: #1980
Assigned to: @MatthewZhuang, @CarltonXiang, @syzsunshine219, @World-controller
Reviewers: @MatthewZhuang, @CarltonXiang, @syzsunshine219, @World-controller
Fix #1377: fix: Title: memos-local-openclaw-plugin corrupts openclaw.…