feat(openclaw-memory-plugin): support per-agent memory isolation#597
feat(openclaw-memory-plugin): support per-agent memory isolation#597xudongcc wants to merge 2 commits intovolcengine:mainfrom
Conversation
2fb9f9d to
5d799a7
Compare
qin-ctx
left a comment
There was a problem hiding this comment.
Good refactor — moving from the stateful setAgentId() pattern to per-request agentId parameters cleanly eliminates the async race condition in multi-agent scenarios and extends isolation to tools (not just hooks). The "main" → "default" backward-compat mapping and the composite cache key (${scope}:${agentId}) are well thought out.
Two non-blocking suggestions below. The merge conflict also needs resolution.
5d799a7 to
d743d4d
Compare
Use the host-provided agent ID to namespace memories so that each agent on the same OpenClaw instance gets its own isolated memory space. The default primary agent "main" maps to "default" for backward compatibility with existing memories. - Pass agentId from ctx to all OpenViking API requests - Update agentId config help text and placeholder - Add "Multi-Agent Memory Isolation" section to README
d743d4d to
4f41780
Compare
|
Thanks for the thorough review! Both suggestions have been addressed:
Additionally, while resolving the merge conflict I noticed an existing TS error (Cannot invoke an object which is possibly 'null'.ts(2721)) on resolveLocalClient(client) introduced by #681's dual-context refactor. Added a non-null assertion since the call is guarded by the isSpawner check which guarantees the assignment. Fixed in a separate commit for clarity. |
|
Confirmed from my side: The root cause is not just "singleton client", but shared mutable per-agent state on the client side, plus cross-agent shared counters like It would make sense to link or close |
Description
Use the host-provided agent ID to namespace memories so that
each agent on the same OpenClaw instance gets its own isolated
memory space. The default primary agent "main" maps to "default"
for backward compatibility with existing memories.
Related Issue
#471
Type of Change
Changes Made
memory_recall,memory_store, andmemory_forgettools do not carry agentIdTesting
Checklist
Screenshots (if applicable)
Additional Notes