Skip to content

Commit 84028f2

Browse files
authored
feat(memos-local-openclaw): add multi-OpenClaw sharing, dual-instance isolation, and viewer improvements (#1321)
## Description This PR brings the `native_memos` branch into `main` with a major upgrade to the `memos-local-openclaw` plugin, focused on team sharing, dual-instance isolation, viewer usability, recall quality, and documentation completeness. It solves several practical issues that appeared during real-world local OpenClaw usage, especially when running multiple instances on the same machine: - team sharing state transitions were fragile across join/leave/role-switch flows - Hub/Viewer ports and session state could conflict in dual-instance setups - admin and member notifications were incomplete or unclear - Viewer polling and sharing UX had refresh/state consistency issues - documentation and landing pages did not fully explain the Hub/Client architecture, multi-instance deployment, and collaboration workflow Implementation approach: - added and hardened the Hub/Client sharing architecture, including Hub auth, client connector flow, server-side status management, admin operations, and notification handling - improved dual-instance isolation by refining runtime/config behavior around gateway-derived ports, sharing state cleanup, and local-vs-hub behavior boundaries - enhanced recall quality with origin tracking, Hub result filtering, and local/hybrid search improvements - improved Viewer UX and stability across sharing setup, admin workflows, polling, notifications, and collaboration-related UI - added and updated automated test coverage for hub server, viewer sharing, connector logic, storage, integration, and skill runtime flows - expanded README, Team Sharing guide, docs site, troubleshooting docs, and landing pages to better document collaboration workflows and multi-OpenClaw capabilities Relevant dependencies / requirements: - no new mandatory external product dependency for end users beyond existing model/provider configuration - local runtime still depends on `better-sqlite3` native bindings being built for the active Node.js version - optional telemetry and model-provider related configuration continue to follow the existing plugin setup Related Issue (Required): Fixes #1320 ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [x] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [x] Refactor (does not change functionality, e.g. code style improvements, linting) - [x] Documentation update ## How Has This Been Tested? The change was validated through a combination of targeted automated coverage added in this branch and manual end-to-end verification of multi-instance local OpenClaw scenarios. Test areas covered in this branch include: - Hub server and authentication behavior - viewer sharing flows and config handling - client connector and sharing state transitions - storage and integration flows - skill runtime and sharing-related scenarios Manual reproduction / verification steps: 1. Start two local OpenClaw instances with isolated `OPENCLAW_CONFIG_PATH`, `OPENCLAW_STATE_DIR`, and workspace directories. 2. Install and enable `memos-local-openclaw` in both instances. 3. Configure one instance as Hub and another as Client. 4. Verify gateway, viewer, and Hub startup behavior, including port isolation and no cross-instance conflict. 5. Submit a join request from the Client, approve it from the Hub, and verify status updates and notifications. 6. Test admin operations including promote, demote, remove member, and self-removal prevention. 7. Test client leave / disable / role-switch behavior and verify state cleanup and reconnect behavior. 8. Verify Viewer live updates do not cause unnecessary full refreshes or scroll-position loss. 9. Open the updated docs / landing pages and confirm installation instructions, Team Sharing content, and collaboration visuals are displayed correctly. Suggested test environment: - OS: macOS - Runtime: local OpenClaw dual-instance setup - Plugin: `memos-local-openclaw` - Database: SQLite / `better-sqlite3` - [ ] Unit Test - [x] Test Script Or Test Steps (please provide) - [ ] Pipeline Automated API Test (please provide) ## Checklist - [x] I have performed a self-review of my own code | 我已自行检查了自己的代码 - [x] I have commented my code in hard-to-understand areas | 我已在难以理解的地方对代码进行了注释 - [x] I have added tests that prove my fix is effective or that my feature works | 我已添加测试以证明我的修复有效或功能正常 - [x] I have created related documentation issue/PR in [MemOS-Docs](https://github.com/MemTensor/MemOS-Docs) (if applicable) | 我已在 [MemOS-Docs](https://github.com/MemTensor/MemOS-Docs) 中创建了相关的文档 issue/PR(如果适用) - [x] I have linked the issue to this PR (if applicable) | 我已将 issue 链接到此 PR(如果适用) - [x] I have mentioned the person who will review this PR | 我已提及将审查此 PR 的人 ## Reviewer Checklist - [x] closes #1320 - [x] Made sure Checks passed - [x] Tests have been provided
2 parents 1fba901 + 9fac874 commit 84028f2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+22136
-1766
lines changed

.github/workflows/openclaw-plugin-publish.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
include:
2626
- os: macos-14
2727
platform: darwin-arm64
28-
- os: macos-13
28+
- os: macos-15
2929
platform: darwin-x64
3030
- os: ubuntu-latest
3131
platform: linux-x64
@@ -42,6 +42,11 @@ jobs:
4242
- name: Install dependencies
4343
run: npm install
4444

45+
- name: Rebuild for x64 under Rosetta (darwin-x64 only)
46+
if: matrix.platform == 'darwin-x64'
47+
run: |
48+
arch -x86_64 npm rebuild better-sqlite3
49+
4550
- name: Collect prebuild
4651
shell: bash
4752
run: |
@@ -87,6 +92,13 @@ jobs:
8792
- name: Install dependencies (skip native build)
8893
run: npm install --ignore-scripts
8994

95+
- name: Generate telemetry credentials
96+
run: node scripts/generate-telemetry-credentials.cjs
97+
env:
98+
MEMOS_ARMS_ENDPOINT: ${{ secrets.MEMOS_ARMS_ENDPOINT }}
99+
MEMOS_ARMS_PID: ${{ secrets.MEMOS_ARMS_PID }}
100+
MEMOS_ARMS_ENV: ${{ secrets.MEMOS_ARMS_ENV }}
101+
90102
- name: Bump version
91103
run: npm version ${{ inputs.version }} --no-git-tag-version
92104

apps/memos-local-openclaw/.env.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,10 @@ SUMMARIZER_TEMPERATURE=0
2323
# No memory content, queries, or personal data is ever sent — only tool names, latencies, and version info.
2424
# Enabled by default. Set to false to opt-out.
2525
# TELEMETRY_ENABLED=false
26+
#
27+
# Telemetry backend credentials (for maintainers / CI only).
28+
# End users do NOT need to set these — they are bundled into the npm package at publish time.
29+
# If not set and telemetry.credentials.json is absent, telemetry is silently disabled.
30+
# MEMOS_ARMS_ENDPOINT=https://your-arms-endpoint.log.aliyuncs.com/rum/web/v2?workspace=...&service_id=...
31+
# MEMOS_ARMS_PID=your-arms-pid
32+
# MEMOS_ARMS_ENV=prod

apps/memos-local-openclaw/.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ dist/
33
*.tsbuildinfo
44
.env
55

6+
# Compiled output (root level only)
7+
/*.js
8+
/*.js.map
9+
/*.d.ts
10+
/*.d.ts.map
11+
612
# OS files
713
.DS_Store
814
Thumbs.db
@@ -19,7 +25,11 @@ ppt/
1925
# Prebuilt native binaries (included in npm package via `files`, not in git)
2026
prebuilds/
2127

28+
# Telemetry credentials (generated by CI, not committed to git)
29+
telemetry.credentials.json
30+
2231
# Database files
2332
*.sqlite
2433
*.sqlite-journal
2534
*.db
35+
/~/.openclaw/

0 commit comments

Comments
 (0)