fix: OpenClaw plugin API compatibility with EverMemOS v1#128
Open
voidfreud wants to merge 1 commit intoEverMind-AI:agent_memoryfrom
Open
fix: OpenClaw plugin API compatibility with EverMemOS v1#128voidfreud wants to merge 1 commit intoEverMind-AI:agent_memoryfrom
voidfreud wants to merge 1 commit intoEverMind-AI:agent_memoryfrom
Conversation
0e436cd to
d27803e
Compare
The plugin was not working out of the box with the current EverMemOS API. Several request format mismatches caused 404, 405, 422, and fetch errors when used with OpenClaw. Fixes: 1. API version: /api/v0/ → /api/v1/ The plugin hardcoded /api/v0/ for both search and capture endpoints, but EverMemOS serves its API under /api/v1/. All requests returned 404. 2. Search field name: group_ids (array) → group_id (string) The plugin sent `group_ids: ["group-name"]` but the EverMemOS /memories/search endpoint expects `group_id: "group-name"` (a plain string). The array field was silently ignored, causing unscoped searches. 3. Capture role mapping: "tool" → "assistant" OpenClaw agent conversations include messages with role "tool" (tool call results). EverMemOS validates roles strictly and only accepts "user" or "assistant", returning HTTP 422 for any other value. Tool and system messages are now mapped to "assistant" since they are part of the assistant's workflow. 4. Search memory_types: array → comma-separated string The plugin sent memory_types as repeated query parameters (memory_types=a&memory_types=b). However, EverMemOS collects query params via dict(request.query_params) which flattens multi-value keys, keeping only the last value. The _parse_memory_types() function already supports comma-separated strings, so sending "a,b" works correctly. 5. README: fix example load.paths Changed the example path from "/path/to/EverMemOS-OpenClaw-Plugin" (wrong case, not a real path) to "~/.openclaw/extensions/evermemos- openclaw-plugin" which is the standard OpenClaw extensions directory. Note: OpenClaw resolves relative paths from the gateway process's working directory (process.cwd()), not from ~/.openclaw/, so using ~/ or absolute paths is required. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
d27803e to
2db0420
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The OpenClaw plugin (
evermemos-openclaw-plugin) does not work out of the box with the current EverMemOS API. Several request format mismatches cause 404, 405, 422, and fetch errors when the plugin runs inside OpenClaw.This PR fixes all five issues found during integration testing:
1. API version:
/api/v0/→/api/v1/The plugin hardcoded
/api/v0/for both search and capture endpoints, but EverMemOS serves its API under/api/v1/. All requests returned 404 Not Found.2. Search field name:
group_ids(array) →group_id(string)The plugin sent
group_ids: ["group-name"]but the EverMemOS/memories/searchendpoint expectsgroup_id: "group-name"(a plain string). The array field was silently ignored, causing unscoped searches.3. Capture role mapping:
"tool"→"assistant"OpenClaw agent conversations include messages with
role: "tool"(tool call results). EverMemOS validates roles strictly and only accepts"user"or"assistant", returning HTTP 422 for any other value. Tool and system messages are now mapped to"assistant"since they are part of the assistant's workflow.4. Search
memory_types: array → comma-separated stringThe plugin sent
memory_typesas repeated query parameters (memory_types=a&memory_types=b). However, EverMemOS collects query params viadict(request.query_params)which flattens multi-value keys, keeping only the last value. The_parse_memory_types()function already supports comma-separated strings, so sending"a,b"works correctly.5. README: fix example
load.pathsChanged the example path from
"/path/to/EverMemOS-OpenClaw-Plugin"(wrong case, not a real path) to"~/.openclaw/extensions/evermemos-openclaw-plugin"which is the standard OpenClaw extensions directory. Note: OpenClaw resolves relative paths from the gateway process's working directory (process.cwd()), not from~/.openclaw/, so using~/or absolute paths is required.Test plan
/api/v1/memories) returns 200 OK and messages accumulate in boundary detectiontool_callsandtool_call_idfields) are stored successfully asrole: "assistant"memory_typescomma-separated format is parsed correctly by_parse_memory_types()memory-coreis correctly disabled when this plugin occupies the memory slot🤖 Generated with Claude Code