Skip to content

fix: OpenClaw plugin API compatibility with EverMemOS v1#128

Open
voidfreud wants to merge 1 commit intoEverMind-AI:agent_memoryfrom
voidfreud:fix/openclaw-plugin-api-compat
Open

fix: OpenClaw plugin API compatibility with EverMemOS v1#128
voidfreud wants to merge 1 commit intoEverMind-AI:agent_memoryfrom
voidfreud:fix/openclaw-plugin-api-compat

Conversation

@voidfreud
Copy link

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/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.

Test plan

  • Verified search requests now return 200 OK with correct results from EverMemOS
  • Verified capture (POST /api/v1/memories) returns 200 OK and messages accumulate in boundary detection
  • Verified tool-call messages (with tool_calls and tool_call_id fields) are stored successfully as role: "assistant"
  • Verified memory_types comma-separated format is parsed correctly by _parse_memory_types()
  • Confirmed memory-core is correctly disabled when this plugin occupies the memory slot

🤖 Generated with Claude Code

@voidfreud voidfreud force-pushed the fix/openclaw-plugin-api-compat branch from 0e436cd to d27803e Compare March 10, 2026 14:46
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>
@voidfreud voidfreud force-pushed the fix/openclaw-plugin-api-compat branch from d27803e to 2db0420 Compare March 10, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant