-
Notifications
You must be signed in to change notification settings - Fork 40
Add OpenClaw memory adapter and MiniLM fix #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
christopherkarani
wants to merge
1
commit into
main
Choose a base branch
from
codex/zig
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| # Wax Memory Plugin For OpenClaw | ||
|
|
||
| This directory packages the Wax/OpenClaw integration contract that reached `9/10` readiness in the Wax repo: | ||
|
|
||
| - native memory-oriented plugin metadata | ||
| - a native plugin entry around `registerMemoryCapability` | ||
| - a deployment contract that points OpenClaw at the verified `wax-mcp` tool surface | ||
| - managed Markdown round-trips via `markdown_export` / `markdown_sync` | ||
|
|
||
| The package is structured to be publishable as a native OpenClaw plugin. | ||
|
|
||
| ## What Is Verified Here | ||
|
|
||
| The Wax side is implemented and tested: | ||
|
|
||
| - broker-managed OpenClaw memory tools | ||
| - `MEMORY.md` / daily note / `DREAMS.md` export | ||
| - `markdown_sync` import + reconcile | ||
| - `DREAMS.md` approval flow for durable promotion | ||
| - HTTP MCP transport for remote deployments | ||
|
|
||
| What still needs to happen in a consuming OpenClaw deployment is installing the package, selecting it in `plugins.slots.memory`, and pointing it at a running Wax MCP endpoint. | ||
|
|
||
| ## Recommended Wax Runtime | ||
|
|
||
| Run Wax as a long-lived HTTP MCP service: | ||
|
|
||
| ```bash | ||
| wax-mcp --no-embedder --transport http --http-host 127.0.0.1 --http-port 3000 | ||
| ``` | ||
|
|
||
| Or use stdio when OpenClaw is colocated with the Wax process: | ||
|
|
||
| ```bash | ||
| wax-mcp --no-embedder | ||
| ``` | ||
|
|
||
| ## Publish | ||
|
|
||
| If you are not publishing under the `@wax` scope, change the package name and `openclaw.install.npmSpec` in `package.json` first. | ||
|
|
||
| Validate the archive: | ||
|
|
||
| ```bash | ||
| cd Resources/openclaw/wax-memory-plugin | ||
| npm pack --dry-run | ||
| ``` | ||
|
|
||
| Publish to npm: | ||
|
|
||
| ```bash | ||
| cd Resources/openclaw/wax-memory-plugin | ||
| npm publish --access public | ||
| ``` | ||
|
|
||
| ## Install In OpenClaw | ||
|
|
||
| Install from npm: | ||
|
|
||
| ```bash | ||
| openclaw plugins install @wax/openclaw-wax-memory | ||
| ``` | ||
|
|
||
| Or install from a local checkout while iterating: | ||
|
|
||
| ```bash | ||
| openclaw plugins install /absolute/path/to/Resources/openclaw/wax-memory-plugin | ||
| ``` | ||
|
|
||
| Select it as the memory plugin in `openclaw.json`: | ||
|
|
||
| ```json | ||
| { | ||
| "plugins": { | ||
| "entries": { | ||
| "wax-memory": { | ||
| "enabled": true, | ||
| "config": { | ||
| "endpoint": "http://127.0.0.1:3000/mcp" | ||
| } | ||
| } | ||
| }, | ||
| "slots": { | ||
| "memory": "wax-memory" | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| Restart the OpenClaw gateway after changing plugin config. | ||
|
|
||
| ## Files | ||
|
|
||
| - `openclaw.plugin.json` | ||
| Native plugin metadata and config schema. | ||
| - `package.json` | ||
| Publishable native OpenClaw package metadata. | ||
| - `src/index.ts` | ||
| Entry showing the `registerMemoryCapability` hook. | ||
|
|
||
| ## OpenClaw Notes | ||
|
|
||
| The current OpenClaw plugin SDK docs indicate: | ||
|
|
||
| - `registerMemoryCapability` is the preferred exclusive memory-plugin API. | ||
| - memory plugins may expose `publicArtifacts.listArtifacts(...)` for exported surfaces. | ||
| - ACP-backed harness sessions can consume the same Wax MCP endpoint through OpenClaw’s ACP bridge or direct MCP client mode. | ||
|
|
||
| This scaffold is intentionally narrow: it avoids inventing OpenClaw host behavior that should live in OpenClaw itself, while still giving the host a concrete integration point. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| { | ||
| "id": "wax-memory", | ||
| "name": "Wax Memory", | ||
| "version": "0.1.21", | ||
| "kind": "memory", | ||
| "description": "Wax-backed memory plugin scaffold for OpenClaw using the verified Wax MCP adapter surface and managed Markdown projections.", | ||
| "configSchema": { | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "endpoint": { | ||
| "type": "string", | ||
| "description": "HTTP MCP endpoint for the Wax broker." | ||
| }, | ||
| "command": { | ||
| "type": "string", | ||
| "description": "Command used when OpenClaw launches the Wax MCP process directly." | ||
| }, | ||
| "args": { | ||
| "type": "array", | ||
| "description": "Arguments passed to the Wax MCP command when OpenClaw launches it directly.", | ||
| "items": { | ||
| "type": "string" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "uiHints": { | ||
| "endpoint": { | ||
| "label": "Wax MCP HTTP Endpoint", | ||
| "placeholder": "http://127.0.0.1:3000/mcp" | ||
| }, | ||
| "command": { | ||
| "label": "Wax MCP Command", | ||
| "placeholder": "wax-mcp" | ||
| }, | ||
| "args": { | ||
| "label": "Wax MCP Arguments", | ||
| "help": "Used only when OpenClaw launches the Wax MCP process directly." | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| { | ||
| "name": "@wax/openclaw-wax-memory", | ||
| "version": "0.1.21", | ||
| "type": "module", | ||
| "description": "OpenClaw memory plugin for Wax-backed agent memory.", | ||
| "license": "Apache-2.0", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/christopherkarani/Wax.git", | ||
| "directory": "Resources/openclaw/wax-memory-plugin" | ||
| }, | ||
| "homepage": "https://github.com/christopherkarani/Wax/tree/main/Resources/openclaw/wax-memory-plugin", | ||
| "bugs": { | ||
| "url": "https://github.com/christopherkarani/Wax/issues" | ||
| }, | ||
| "keywords": [ | ||
| "openclaw", | ||
| "plugin", | ||
| "memory", | ||
| "mcp", | ||
| "wax" | ||
| ], | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "openclaw": { | ||
| "extensions": [ | ||
| "./src/index.ts" | ||
| ], | ||
| "compat": { | ||
| "pluginApi": ">=2026.3.24-beta.2", | ||
| "minGatewayVersion": "2026.3.24-beta.2" | ||
| }, | ||
| "build": { | ||
| "target": "node20", | ||
| "format": "esm" | ||
| }, | ||
| "install": { | ||
| "npmSpec": "@wax/openclaw-wax-memory", | ||
| "defaultChoice": "npm", | ||
| "minHostVersion": ">=2026.3.24-beta.2" | ||
| } | ||
| }, | ||
| "files": [ | ||
| "src", | ||
| "openclaw.plugin.json", | ||
| "README.md" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry"; | ||
| import { registerMemoryCapability } from "openclaw/plugin-sdk/memory-core"; | ||
|
|
||
| const DEFAULT_HTTP_ENDPOINT = "http://127.0.0.1:3000/mcp"; | ||
|
|
||
| export default definePluginEntry((api) => { | ||
| registerMemoryCapability(api, { | ||
| id: "wax-memory", | ||
| displayName: "Wax Memory", | ||
| description: | ||
| "Uses the Wax MCP broker as the canonical memory runtime and exposes managed Markdown artifacts for MEMORY.md, daily notes, and DREAMS.md review.", | ||
| publicArtifacts: { | ||
| async listArtifacts() { | ||
| return [ | ||
| { | ||
| id: "wax-memory-md", | ||
| label: "Wax MEMORY.md projection", | ||
| kind: "markdown", | ||
| }, | ||
| { | ||
| id: "wax-dreams-md", | ||
| label: "Wax DREAMS.md review queue", | ||
| kind: "markdown", | ||
| }, | ||
| ]; | ||
| }, | ||
| }, | ||
| runtime: { | ||
| transport: "mcp-http", | ||
| endpoint: api.pluginConfig?.endpoint ?? DEFAULT_HTTP_ENDPOINT, | ||
| command: api.pluginConfig?.command ?? "wax-mcp", | ||
| args: api.pluginConfig?.args ?? ["--no-embedder", "--transport", "http", "--http-port", "3000"], | ||
| }, | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
brokerShutdownCompletedthrows ifStoreLockProbe.preflightExclusiveAccesscannot get the lock within 50ms, andshutdownStartedBrokerdoes not catch that exception inside its retry loop. In practice, broker shutdown can leave the lock held briefly after the socket disappears, so this path can fail immediately instead of waiting մինչև the configured deadline, causing spurious shutdown errors even when the broker would have exited cleanly moments later.Useful? React with 👍 / 👎.