Skip to content

Openclaw local plugin 20260408#1450

Closed
hijzy wants to merge 24 commits intomainfrom
openclaw-local-plugin-20260408
Closed

Openclaw local plugin 20260408#1450
hijzy wants to merge 24 commits intomainfrom
openclaw-local-plugin-20260408

Conversation

@hijzy
Copy link
Copy Markdown
Collaborator

@hijzy hijzy commented Apr 9, 2026

Description

Please include a summary of the change, the problem it solves, the implementation approach, and relevant context. List any dependencies required for this change.

Related Issue (Required): Fixes #issue_number

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (does not change functionality, e.g. code style improvements, linting)
  • Documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Unit Test
  • Test Script Or Test Steps (please provide)
  • Pipeline Automated API Test (please provide)

Checklist

  • I have performed a self-review of my own code | 我已自行检查了自己的代码
  • I have commented my code in hard-to-understand areas | 我已在难以理解的地方对代码进行了注释
  • I have added tests that prove my fix is effective or that my feature works | 我已添加测试以证明我的修复有效或功能正常
  • I have created related documentation issue/PR in MemOS-Docs (if applicable) | 我已在 MemOS-Docs 中创建了相关的文档 issue/PR(如果适用)
  • I have linked the issue to this PR (if applicable) | 我已将 issue 链接到此 PR(如果适用)
  • I have mentioned the person who will review this PR | 我已提及将审查此 PR 的人

Reviewer Checklist

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Made sure Checks passed
  • Tests have been provided

hijzy and others added 24 commits April 8, 2026 14:57
## Summary
- register memos-local on the current memory capability surface
- update install flow to use the global OpenClaw CLI and wait for viewer
readiness
- refresh affected tests for current tool registration and memory_search
result shapes

## Validation
- npm test -- --run tests/plugin-impl-access.test.ts
tests/plugin-openclaw-wiring.test.ts tests/shutdown-lifecycle.test.ts
- npm test -- --run tests/incremental-sharing.test.ts
tests/integration.test.ts
- Standalone Hermes Agent memory plugin (apps/memos-local-plugin)
- Node.js bridge daemon for JSON-RPC memory operations
- Python adapters for Hermes and OpenHarness agents
- One-line install script: auto Node.js setup, npm download, config, daemon start
- Memory Viewer web UI (port 18901)
- npm package: @memtensor/memos-local-hermes-plugin
## Summary

Add a standalone **Hermes Agent memory plugin**
(`apps/memos-local-plugin`) that provides persistent memory capabilities
for Hermes Agent via a Node.js bridge daemon.

- **One-click installer**: `curl -fsSL <install-url> | bash` —
auto-detects & installs Node.js, downloads npm package, configures
Hermes, starts memory daemon
- **Node.js bridge daemon** (`bridge.cts`): JSON-RPC server for memory
capture/recall/search operations
- **Python adapters**: Hermes adapter (`adapters/hermes/`) with
`MemTensorProvider` class + OpenHarness adapter
(`adapters/openharness/`)
- **Memory Viewer**: Web UI on port 18901 for browsing and managing
stored memories
- **npm package**: `@memtensor/memos-local-hermes-plugin` — ready for
npm publish
- **Documentation**: `www/docs/index.html` with bilingual (EN/ZH)
install guide

### Key files

| Path | Description |
|------|------------|
| `apps/memos-local-plugin/install.sh` | One-click installer (auto
Node.js, npm download, config, daemon start) |
| `apps/memos-local-plugin/bridge.cts` | Node.js JSON-RPC bridge daemon
|
| `apps/memos-local-plugin/index.ts` | Core plugin entry (extends
memos-local-openclaw) |
| `apps/memos-local-plugin/adapters/hermes/` | Hermes agent Python
adapter |
| `apps/memos-local-plugin/adapters/openharness/` | OpenHarness agent
adapter |
| `apps/memos-local-plugin/src/` | Shared core source (viewer, storage,
recall, ingest, etc.) |

### No changes to `memos-local-openclaw`

This PR only adds the new `apps/memos-local-plugin/` directory. The
existing `apps/memos-local-openclaw/` plugin is untouched.

## Test plan

- [ ] Run `install.sh` on a fresh Linux server with Hermes Agent
installed
- [ ] Verify Node.js auto-install if missing
- [ ] Verify `~/.hermes/config.yaml` is updated with `provider:
memtensor`
- [ ] Verify memory daemon starts and viewer is accessible at
`http://127.0.0.1:18901`
- [ ] Run `hermes chat` and confirm memory capture/recall works
- [ ] `npm pack` produces correct tarball with all required files
Point curl one-liner to MemTensor/MemOS repo on openclaw-local-plugin-20260408 branch.
- Add publishConfig, repository, prebuilds to package.json for npm publishing
- Create hermes-plugin-publish.yml workflow (multi-platform prebuild + publish)

Made-with: Cursor
## Summary
- Update `apps/memos-local-plugin/package.json` for npm publishing: add
`publishConfig` (public access), `repository` info, and `prebuilds` to
`files` array
- Add `.github/workflows/hermes-plugin-publish.yml` — multi-platform
prebuild + publish workflow (mirrors the existing OpenClaw workflow,
targeting `apps/memos-local-plugin`)

## Changes
- **`apps/memos-local-plugin/package.json`**: added `repository`,
`publishConfig`, `prebuilds` in `files`, `prepublishOnly` script,
`hermes` keyword
- **`.github/workflows/hermes-plugin-publish.yml`**: new
workflow_dispatch workflow that builds `better-sqlite3` prebuilds on 4
platforms (darwin-arm64, darwin-x64, linux-x64, win32-x64) and publishes
`@memtensor/memos-local-hermes-plugin` to npm

## How to use
After merging, go to **Actions → "Hermes Plugin — Build Prebuilds &
Publish"** → Run workflow → input version (e.g. `1.0.0`) and dist-tag
(`latest` or `beta`).
npm pack requires explicit version for prerelease packages. The script
now queries npm for the latest published version automatically, and
accepts --version <ver> to pin a specific release.
## Summary

- **Auto-resolve latest npm version**: `install.sh` now queries `npm
view` for the latest published version before downloading, fixing the
issue where `npm pack` fails for prerelease versions (e.g.
`1.0.0-beta.1`) without an explicit version specifier
- **`--version` flag**: Users can pin a specific version via `bash
install.sh --version 1.0.0-beta.1` or `curl ... | bash -s -- --version
<ver>`
- **Update download URL**: Point the curl one-liner in `install.sh` and
`www/docs/index.html` to the actual GitHub raw path
(`MemTensor/MemOS/openclaw-local-plugin-20260408`)

## Changed files

| File | Change |
|------|--------|
| `apps/memos-local-plugin/install.sh` | Add `--version` arg parsing,
auto-resolve latest version via `npm view` |
| `apps/memos-local-plugin/www/docs/index.html` | Update curl URL in
docs |

## Test plan

- [ ] `curl -fsSL <raw-url>/install.sh | bash` — auto-downloads
`1.0.0-beta.1`
- [ ] `curl ... | bash -s -- --version 1.0.0-beta.1` — explicit version
works
- [ ] Verify docs page shows correct install command
- Add comprehensive README.md covering features, quick start, adapters,
  pipelines, agent tools, viewer, configuration, and troubleshooting
- Add README.md to package.json files array so it ships with npm package

Made-with: Cursor
## Summary
- Add comprehensive `README.md` for the Hermes memory plugin, adapted
from the OpenClaw plugin README
- Add `README.md` to `package.json` `files` array so it ships with npm
package

## Content
The README covers:
- Feature overview (memory engine, task summarization, skill evolution,
viewer)
- Quick start (install script, npm install, configuration)
- Bridge modes (stdio + daemon)
- Adapter documentation (Hermes + OpenHarness)
- Pipeline explanations (write, task, skill, retrieval)
- Agent tools reference
- Memory Viewer pages
- Advanced configuration
- Telemetry policy
- Project structure
- Development guide
- Troubleshooting

## Note
After merging, re-publish the npm package (e.g. `1.0.1` or
`1.0.0-beta.2`) to include the README on the npm page.
- Replace all 28 user-visible "OpenClaw" references with "MemTensor" in viewer UI
- Fix embedding warning banner not dismissing after model is configured
- Update server.ts branding regex to match new MemTensor text
…h order

Hermes calls sync_all() before queue_prefetch_all(), causing the current
turn's data to be ingested before the next prefetch search runs. This
means search results always contain the just-added turn — redundant and
wasteful.

Fix: sync_turn() now stashes data instead of ingesting immediately.
queue_prefetch() picks it up and flushes AFTER the search completes,
ensuring recalled memories never include the current turn.
- Add trivial content detection (empty JSON acks, error prefixes, status
  messages) in both Python adapter and TS ingest worker to avoid polluting
  long-term memory with noise
- Guard against empty messages in deferred ingest flush
- Rename internal references from OpenClaw to host-agnostic naming
  (config.py, install.sh)
…er (#1446)

## Summary

### 1. Rebrand viewer from OpenClaw to MemTensor
- Replace all 28 user-visible "OpenClaw" references with "MemTensor" in
the memory viewer UI
- Update `server.ts` branding replacement regex to match new text

### 2. Fix embedding warning banner
- Banner now dismisses when a configured (non-local) embedding provider
is detected
- Previously the warning persisted forever after first page load due to
`_embeddingWarningShown` flag

### 3. Fix memory_add/search order (critical)
- **Problem**: Hermes calls `sync_all()` before `queue_prefetch_all()`,
so the current turn's data was ingested before the next prefetch search
ran. This caused every search to return the just-added turn content —
redundant and wasting context window.
- **Fix**: `sync_turn()` now defers ingest by stashing the data.
`queue_prefetch()` picks it up and flushes AFTER the search completes.
This ensures recalled memories never include the current turn.
- `on_session_end()` flushes any remaining deferred ingest to prevent
data loss.

## Changed files

| File | Change |
|------|--------|
| `adapters/hermes/__init__.py` | Defer ingest, search-before-add
ordering |
| `src/viewer/html.ts` | Rebrand OpenClaw → MemTensor, fix embedding
banner |
| `src/viewer/server.ts` | Update branding regex |

## Test plan

- [ ] Start `hermes chat`, send a message — verify logs show `search`
before `add`
- [ ] Verify search results don't contain the message just sent
- [ ] Verify viewer title shows "MemTensor Memory"
- [ ] Configure embedding model → warning banner disappears
- [ ] Exit session → verify deferred ingest is flushed (no data loss)
If Node.js >= 18 is not found, the installer now automatically installs
Node.js 22 via Homebrew (macOS) or NodeSource (Linux apt/dnf/yum)
instead of just printing an error and exiting. Also adds colored output
for better readability during installation.
## Summary

- If Node.js >= 18 is not found, the hermes plugin installer now
**automatically installs Node.js 22** instead of just printing an error
and exiting
- Supports macOS (Homebrew) and Linux (NodeSource for apt/dnf/yum)
- Adds colored terminal output (info/success/warn/error) for better
readability during installation

## Details

The `ensure_node()` function checks the current Node.js version. If it's
missing or below 18, `install_node22()` is called:

| Platform | Method |
|----------|--------|
| macOS | `brew install node@22` (requires Homebrew) |
| Debian/Ubuntu | NodeSource `setup_22.x` + `apt-get install nodejs` |
| Fedora | NodeSource `setup_22.x` + `dnf install nodejs` |
| CentOS/RHEL | NodeSource `setup_22.x` + `yum install nodejs` |
| Other | Error with manual install instructions |

After installation, the version is re-checked to confirm success.

## Test plan

- [ ] Run `install.sh` on macOS with Node.js already installed — should
print green checkmark and continue
- [ ] Run `install.sh` on a clean environment without Node.js — should
auto-install and proceed
- [ ] Run `install.sh` with Node.js < 18 — should upgrade and proceed
- [ ] Verify colored output renders correctly in terminal
@hijzy hijzy closed this Apr 9, 2026
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.

2 participants