feat(integrations/OpenClaw): add OpenClaw PowerContext memory plugin - #1282
feat(integrations/OpenClaw): add OpenClaw PowerContext memory plugin#1282XnLemon wants to merge 5 commits into
Conversation
| runtime: createPowerContextMemoryRuntime(dependencies), | ||
| }); | ||
|
|
||
| api.registerTool((ctx) => |
There was a problem hiding this comment.
OpenClaw already creates its own memory_search before loading plugin tools, so this registration is dropped as a name conflict on 2026.8.1-beta.2. In a managed-install E2E, memory_store and automatic recall reached PowerContext, but an explicit memory_search used the built-in file index instead. This also leaves memory_revise and memory_retire without a reliable way to obtain their required citation. Please either use a non-conflicting tool name and update the prompt, manifest, and docs, or require a host version whose built-in tool delegates to this memory runtime, with an exact-host regression test.
| }; | ||
| const rememberScope = (sessionId: string | undefined, scopeId: string) => { | ||
| if (sessionId) { | ||
| sessionScopes.set(sessionId, scopeId); |
There was a problem hiding this comment.
sessionScopes keeps only one scope per session. In project mode, if a session sees project A and then project B, B overwrites A, so session_end flushes only B. I reproduced this against the built plugin: two captured project scopes produced a single flush for the second scope. Please retain a bounded set of observed scopes and flush each one, or flush on project transitions, and add a regression test for a session that changes projects.
Which issue or RFC does this PR close?
Closes #1281.
Rationale for this change
OpenClaw needs a memory provider that can use PowerContext's durable, scoped memory backend without modifying OpenClaw core. OpenClaw remains responsible for agent identity, privacy decisions, transcripts, and lifecycle hooks, while PowerContext provides memory storage, search, recall, and processing.
What changes are included in this PR?
memoryprovider slot.memory_search,memory_store,memory_revise, andmemory_retire.Evidence(Currently filling in the missing details)
Are there any user-facing changes?
Yes.
Users can install the plugin through OpenClaw's standard managed local-plugin flow:
openclaw plugins install . --forceAfter publication, it can be installed from npm:
The plugin requires OpenClaw
2026.8.1-beta.2or newer. No OpenClaw core source changes or public PowerContext API breaking changes are introduced.How was this change tested?
pnpm typecheckpnpm testwith 6 tests passingpnpm buildpnpm pack:localuv run prek run -auv run zensical build -sAI usage statement
AI tools were used during development and validation. Codex based on GPT-5 was used to inspect the repositories, implement the integration and documentation, run tests, and validate the OpenClaw plugin installation and runtime behavior.
中文翻译
此 PR 关闭哪个 Issue 或 RFC?
关闭 #1281。
变更原因
OpenClaw 需要一个能够使用 PowerContext 持久化、隔离 Memory 的提供方,同时不修改 OpenClaw 核心代码。OpenClaw 继续负责 Agent 身份、隐私判断、transcript 和生命周期钩子,PowerContext 负责 Memory 的存储、搜索、召回和处理。
此 PR 包含哪些变更?
memoryprovider slot。memory_search、memory_store、memory_revise和memory_retire工具。是否有面向用户的变更?
有。
用户可以使用 OpenClaw 标准的托管本地插件流程安装:
openclaw plugins install . --force发布到 npm 后,可以使用:
插件要求 OpenClaw
2026.8.1-beta.2或更高版本。不修改 OpenClaw 核心代码,也不改变 PowerContext 的公共 API。如何测试?
pnpm typecheckpnpm test,6 个测试通过pnpm buildpnpm pack:localuv run prek run -auv run zensical build -sAI 使用声明
本 PR 的开发和验证过程中使用了 AI 工具。Codex(GPT-5)用于检查代码库、实现集成和文档、运行测试,以及验证 OpenClaw 插件的安装和运行时行为。