fix(memory): release memory_get/memory_search from OpenClaw memory-core - #3222
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7c8396208e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
7c83962 to
9599000
Compare
|
All three review threads answered; head is now Fixed here
Deferred — #3225
Resolving the deferred thread rather than leaving it open, since the repo's |
ikunkun-sys
left a comment
There was a problem hiding this comment.
🤖 AI review by codex-runner · Agent: Reviewer · 判定:REQUEST_CHANGES
-
变更概述
审查 head:9599000c。安装脚本禁用memory-core,释放两个同名工具;卸载时依据标记恢复,并补充OPENCLAW_BIN支持、测试及中英文说明。 -
正确性
[P2] 卸载会覆盖用户后来选择的 memory 插件。
uninstall.sh:80–82 仅凭标记调用plugins enable memory-core,没有检查当前 slot。如果用户安装后切换至memory-lancedb,再卸载memory-anolisa,该调用会把 slot 强制切回memory-core。通过只读调用本机 OpenClaw 的实际 slot 选择函数,已复现这一覆盖。现有测试只检查 enable 调用和标记,没有验证其他 slot 所有者是否保留。需要保护用户后续选择,并补充此生命周期用例。 -
风格与一致性
中英文说明一致,脚本延续现有约定。bash -n、ShellCheck 和git diff --check均通过,未发现阻塞性风格问题。 -
风险
上述覆盖会使用户切换后的记忆后端停止承担检索。另,adapter-manager 路径仍未修复,已明确记录于文档及 #3225。完整安装测试和 OpenClaw 2026.9.2 端到端验证未在本次只读环境重跑;作者测试报告与本地检查应分别看待。 -
合并建议
建议修复卸载覆盖当前 slot 的问题后再合并。
结论:REQUEST_CHANGES
9599000 to
34eca98
Compare
|
@ikunkun-sys Fixed in P2 — uninstall overwrote a memory plugin the operator chose later Confirmed against the code before touching it. The restore was gated on
Only a positively identified third owner blocks the restore. Empty / On a skip the script prints the owner, why it will not override it, and the command that does ( Tests —
Reverting
中文摘要:已按 review 修复。 |
ikunkun-sys
left a comment
There was a problem hiding this comment.
审查 head:34eca9853a954a2e8e5ac01ccc93dff8b02eb213。
此前切换到 memory-lancedb 后卸载会覆盖 slot 的问题已修复,但仍有一个 P2:plugins.slots.memory="none" 被当成未配置状态,卸载会重新启用 memory-core,撤销用户明确禁用 memory 的选择。详见 inline finding。
本地验证:安装/卸载脚本测试、bash -n、shellcheck -x、git diff --check 均通过;使用真实 OpenClaw 2026.5.27、隔离的临时配置与最小 memory 插件 fixture,运行当前 uninstall.sh,复现 slot 从 none 变为 memory-core、enabled 从 false 变为 true、恢复标记删除,退出码为 0。未重跑完整 gateway 工具调用端到端测试,也未独立重跑作者报告的 2026.9.2 E2E。
提交前刷新:head 未变,CI 已执行检查全部成功;mergeable=MERGEABLE、mergeStateStatus=BLOCKED、reviewDecision=CHANGES_REQUESTED,原有 3 个 inline 线程均已解决。
结论:REQUEST_CHANGES
OpenClaw keeps its bundled memory-core plugin loaded as the memory
consolidation ("dreaming") sidecar even after another plugin takes the
memory slot, and memory-core owns the memory_get / memory_search tool
names. OpenClaw's plugin tool registry is first-wins and drops a plugin
tool whose normalized name is already taken, so memory-anolisa's
same-named tools never reach the agent: the gateway logs
"plugin tool name conflict (memory-anolisa): memory_get" and agent calls
bind to memory-core's workspace-file reader, which answers
disabled:true for every path under ~/.anolisa/memory, including files
that are on disk.
install.sh now runs `openclaw plugins disable memory-core` after the
plugin install, which releases both names. The memory slot already
routes memory traffic through this plugin, so nothing else changes for
the agent; the visible cost is that `openclaw memory` and MEMORY.md
dreaming come from memory-core and stay unavailable until uninstall.
`plugins disable` is idempotent and exits 0 either way, so its status
cannot separate a real transition from a no-op. install.sh therefore
reads plugins.entries.memory-core.enabled first and records the disable
in ${OPENCLAW_STATE_DIR}/.anolisa-memory-anolisa-disabled-memory-core
only when it caused that transition; uninstall.sh re-enables memory-core
from that record, so a memory-core an operator disabled themselves is
left untouched. An unreadable answer still records it, because the
failure modes are not symmetric: skipping the record strands the host
with no memory plugin at all after an uninstall, since `plugins
uninstall` resets the slot to its memory-core default while config still
says enabled=false, whereas an unwanted restore costs one `plugins
disable`. The install log names that case. uninstall.sh also resolves
the CLI through OPENCLAW_BIN the way install.sh does, so an
absolute-path override still gets its restore instead of a "CLI not
found" that leaves memory-core off.
The record is necessary but not sufficient. It says install.sh disabled
memory-core, not that this plugin still owns the memory slot, and
`plugins enable` re-runs OpenClaw's exclusive slot selection — so a
restore driven by the record alone dragged the slot back from a backend
the operator chose afterwards (`plugins enable memory-lancedb`, or an
explicit plugins.slots.memory edit), and the backend they picked then
silently stopped serving retrieval. uninstall.sh now reads
plugins.slots.memory before deciding, through `config get` with
openclaw.json as the fallback for a CLI that cannot answer, and skips
the restore when the operator has since made that slot their own —
naming the reason, the command that overrides the skip, and keeping the
marker, which still records that memory-core is off because of an
anolisa install. Choosing no memory plugin at all is such a choice:
OpenClaw documents plugins.slots.memory = "none" as an explicit "disable
memory plugins" value, not as an unset slot, and `plugins enable` answers
it with `Exclusive slot "memory" switched from "none" to "memory-core".`
— so classifying "none" as "nobody owns the slot" re-enabled a backend
the operator had deliberately turned off. Only a positively identified
operator choice blocks the restore now, a third-party owner or "none":
an empty, this-plugin-owned, memory-core-owned or unreadable slot
restores as before, because skipping there is what strands the host with
no memory backend at all.
A failed disable warns and still exits 0: memory_observe, auto-recall
and auto-capture keep working, and the warning names the exact command
that finishes the job.
Only install.sh performs this hand-off. `anolisa adapter enable
agent-memory openclaw` runs `plugins install` from the built-in OpenClaw
driver and never executes the adapter's install.sh, so the conflict
survives on that path; the docs now say which entry point hands off and
give the manual commands, and #3225 tracks carrying the hand-off in the
driver's receipt lifecycle.
Fixes #3218
Co-authored-by: multica-agent <github@multica.ai>
34eca98 to
57df63f
Compare
|
@ikunkun-sys 第 2 轮的 P2 已修复,请重新 review。 head:
真机复核(OpenClaw 2026.5.22 + 隔离 state dir + 最小插件 fixture): 细节见 inline thread 的答复。未重跑 gateway 工具调用 E2E,也未复跑 2026.9.2 E2E —— 与你的验证边界一致。 |
ikunkun-sys
left a comment
There was a problem hiding this comment.
复审 head:57df63ff16bff686c2a3ba76646bcfbaf663fccc。未发现新的阻塞问题,上一轮 P2「卸载撤销 memory=none 的明确禁用选择」已修复。
已检查完整变更及相对上一轮的 range-diff。none 现在独立阻止恢复,保留 slot、memory-core 的禁用状态及恢复标记;CLI 读取与 openclaw.json 回退测试均覆盖该语义,双语说明同步。
本地验证:
make test-openclaw-install:65 PASS,退出码 0。bash -n、shellcheck -x、git diff --check:通过。- 真实 OpenClaw 2026.5.27 + 隔离临时配置 + 最小插件 fixture:确认
none和memory-lancedb均被保留,memory-core 保持禁用且标记保留;卸载自身占用的 slot 时正常恢复 memory-core 并移除标记。 - 相同 none 用例在旧 head
34eca9853上仍复现覆盖,确认新版本消除了原问题。
验证边界:本地真实 CLI 验证止于卸载后的配置及标记状态,未重跑 gateway 工具调用或 OpenClaw 2026.9.2 E2E。
提交前刷新:head 未变,CI 已运行检查全部成功,4 个审查线程均已解决。提交前 mergeable=MERGEABLE、mergeStateStatus=BLOCKED、reviewDecision=CHANGES_REQUESTED;本次批准更新此前的审查结论。
结论:APPROVE
What
install.shnow runsopenclaw plugins disable memory-coreafter installing the plugin, anduninstall.shre-enables it — but only wheninstall.shis what disabled it.Fixes #3218
Why the plugin's
memory_get/memory_searchwere droppedThe issue report attributed the conflict to "built-in"
memory_get/memory_searchtools added in OpenClaw 2026.9.2. Those two names do appear in OpenClaw's core tool catalog (src/agents/tool-catalog.ts,sectionId: "memory",includeInOpenClawGroup: true), but the catalog is pure data — it drives profile allowlists, group expansion and Control-UI metadata, not tool construction. The tools themselves come from the bundledmemory-coreplugin (dist/extensions/memory-core/openclaw.plugin.json,contracts.tools: ["intent", "memory_get", "memory_search"]).So this is a slot-exclusivity gap, not a new core tool:
plugins.slots.memory = "memory-anolisa"does disablememory-corefor memory purposes —openclaw plugins listreports itdisabled.resolveAuthorizedDreamingSidecar/resolveDreamingSidecarEngineId: any pinned slot other thanmemory-core+dreaming.enabled, which defaults to true).openclaw plugins doctorsays exactly this:memory-core: memory plugin not selected for the memory slot; skipping its indexing runtime and recall registration (consolidation lifecycle preserved).memory-coretherefore still registersmemory_get/memory_search, and OpenClaw's plugin tool registry is first-wins — it logsplugin tool name conflict (memory-anolisa): memory_getandcontinues, so this plugin's tools never reach the agent.memory-core's reader. With nocorpusargument,executeMemoryReadResultonly tries the workspace builtin read and never consults corpus supplements; that read throws for a~/.anolisa/memorypath, and the catch returns{path, text: "", disabled: true, error}— the reported symptom.Reproduced and verified on real OpenClaw 2026.9.2
Installed the built plugin into a scratch
OPENCLAW_STATE_DIRand captured the tool array actually sent to the model (stub OpenAI-compatible endpoint), so the assertion is on the agent's real tool set rather than on a log line.Before (slot pinned to
memory-anolisa, stock install):After (
install.shfrom this PR):All four contract tools now reach the agent, and
memory_getis ours.Full lifecycle on 2026.9.2:
plugins.slots.memoryplugins.entries.memory-coreinstall.shmemory-anolisa{enabled: false}install.shagain (upgrade)memory-anolisa{enabled: false}uninstall.sh{}(host default = memory-core){enabled: true}uninstall.shwith no markerfalse)Also checked on the locally installed OpenClaw 2026.5.22:
plugins disableexists there too and is idempotent (rc=0 on repeat, rc=1 only for an unknown plugin), so the step is safe on the older hosts the manifest still claims.Design notes
memory_getbound tomemory-core, so an agent callingmemory_get— including the nightly's own repro prompt — would still getdisabled: true. The contract names inopenclaw.plugin.jsonalso stay untouched, so nothing downstream of the contract changes.openclaw config getis not a reliable oracle — on a host whoseopenclaw.jsonfails validation it prints nothing on stdout and exits 1 (reproduced: OpenClaw rejects themetakey it wrote itself). Recording our own action is exact, and it makesuninstall.shrestore only whatinstall.shchanged.memory_observe,memory_get_context, auto-recall, auto-capture, the MCP transport) is unaffected, so failing the whole install would be worse. The warning namesopenclaw plugins disable memory-coreas the manual completion step.openclaw memorysubcommands andMEMORY.mddreaming/consolidation (bothmemory-core-provided) are unavailable. That is the same trade-off OpenClaw's own docs describe for a memory-slot plugin ("only one plugin owns the active memory slot at a time"), and it is whatopenclaw plugins uninstallalready implies by resetting the slot tomemory-core.Worth reporting upstream: a slot plugin cannot take over
memory_get/memory_searchwhile the dreaming sidecar keepsmemory-core's tools registered. Either the sidecar should not contribute tools, or the registry should let the slot owner win.Tests
src/agent-memory/tests/test-openclaw-adapter-install.sh— extended (runs in CI viamake test-openclaw-install):plugins disable memory-coreand a written marker; every failed-install scenario asserts neither (no host mutation after a failed install).uninstall.shre-enablesmemory-coreand clears the marker when marked, and leaves an unmarkedmemory-corealone.expected exactly one 'plugins disable memory-core', got 0.shellcheck -xclean on both scripts and the test.bash scripts/docs-lint.shandpython3 scripts/docs-link-check.pygreen.npm testin the plugin dir unchanged (126 pass) — no TypeScript touched.Docs
docs/user-guide/{en,zh}/token-saving/agent-memory.md: one paragraph in the OpenClaw install section explaining the disable, the marker, the restore and the trade-offs, plus a troubleshooting row keyed on the two observable symptoms (disabled: trueand theplugin tool name conflictlog line).