MemOS icon indicating copy to clipboard operation
MemOS copied to clipboard

feat(memos-local-openclaw): support robust multi-OpenClaw sharing and dual-instance isolation

Open tangbotony opened this issue 8 months ago • 2 comments

Pre-submission checklist | 提交前检查

  • [x] I have searched existing issues and this hasn't been mentioned before | 我已搜索现有问题,确认此问题尚未被提及
  • [x] I have read the project documentation and confirmed this issue doesn't already exist | 我已阅读项目文档并确认此问题尚未存在
  • [x] This issue is specific to MemOS and not a general software issue | 该问题是针对 MemOS 的,而不是一般软件问题

Problem Statement | 问题陈述

  • [x] I have searched existing issues and this hasn't been mentioned before | 我已搜索现有问题,确认此问题尚未被提及
  • [x] I have read the project documentation and confirmed this issue doesn't already exist | 我已阅读项目文档并确认此问题尚未存在
  • [x] This issue is specific to MemOS and not a general software issue | 该问题是针对 MemOS 的,而不是一般软件问题

Problem Statement | 问题陈述

memos-local-openclaw currently lacks a complete and robust solution for multi-OpenClaw collaboration, especially when multiple OpenClaw instances are running on the same machine and need to share memories, tasks, and skills through a Hub/Client model.

In practice, several problems appear in this scenario:

  • Viewer / Hub ports may conflict across multiple local OpenClaw instances
  • agent identity, database, workspace, and session boundaries may not be isolated clearly enough
  • client join / pending approval / approval / leave / disable / role-switch flows can become inconsistent
  • admin actions such as promote / demote / remove member need clearer safeguards and notifications
  • Hub shutdown / restart and client reconnect flows need to be more robust
  • sharing-related notifications are incomplete or unclear in some cases
  • documentation and landing pages do not fully explain the multi-OpenClaw collaboration architecture and deployment model

As MemOS is increasingly used in local multi-agent and multi-instance workflows, we need first-class support for multi-OpenClaw sharing rather than a single-instance-only experience.

Proposed Feature / Expected Outcome

Add a robust multi-OpenClaw team sharing solution for memos-local-openclaw, including:

  • clear Hub / Client collaboration architecture
  • dual-instance and multi-instance isolation on the same machine
  • reliable state transitions for join / approve / reject / leave / disable / switch role
  • conflict-free Viewer / Hub startup behavior
  • isolated agent ID / database / session / workspace behavior across instances
  • complete admin workflow for approval, member management, and role changes
  • clear notifications for sharing, unsharing, removal, role changes, Hub online/offline events
  • improved documentation and landing-page guidance for team sharing and multi-instance deployment

Acceptance Criteria

  • multiple OpenClaw instances can run on the same machine without Viewer / Hub port conflicts
  • each instance keeps its own identity, workspace, session, and storage boundaries
  • Hub / Client state remains consistent during pending approval, approval, leave, disable, and role-switch scenarios
  • admin operations are guarded and user-visible, including self-removal prevention and role-change notifications
  • client instances can handle Hub shutdown / recovery gracefully
  • docs and website clearly explain multi-OpenClaw sharing architecture, setup steps, and operational behavior

Additional Context

This feature is intended to support a practical local collaboration model:

  • one OpenClaw instance can act as a Hub
  • multiple other OpenClaw instances can join as Clients
  • private data remains local unless explicitly shared
  • shared memories, tasks, and skills can circulate across instances in a controlled way

This would make memos-local-openclaw much more useful for real-world team workflows, personal/work dual-instance setups, and multi-agent collaboration scenarios.

Willingness to Implement | 实现意愿

  • [x] I'm willing to implement this myself | 我愿意自己解决

Willingness to Implement | 实现意愿

  • [ ] I'm willing to implement this myself | 我愿意自己解决
  • [ ] I would like someone else to implement this | 我希望其他人来解决

tangbotony avatar Mar 23 '26 07:03 tangbotony

This issue has been automatically marked as stale due to inactivity.

github-actions[bot] avatar Apr 23 '26 03:04 github-actions[bot]

Closing as completed — this functionality has already landed on main.

Tracking note: the original PR #1320 (which declared closes #1319) was closed without merging, so GitHub never auto-closed this issue. The feature was instead delivered via later commits on main (e.g. e8edc18d, 760620cb, plus the hub/client foundation), all present on origin/main.

All acceptance criteria are met:

  • Port-conflict-free multi-instance — Viewer port = gatewayPort + 10, Hub port = gatewayPort + 11, with automatic retry over consecutive ports on EADDRINUSE.
  • Per-instance isolation — port-scoped session cookies and OPENCLAW_STATE_DIR-based state/DB separation.
  • Consistent Hub/Client state — join / approve / reject / leave / disable / role-switch endpoints plus client reconnect logic (src/hub, src/client), covered by hub-server, client-connector, viewer-sharing, and incremental-sharing tests.
  • Guarded admin actions — self-removal prevention (cannot_remove_self), owner protection (cannot_remove_owner / cannot_demote_owner), and role-change / resource / hub-status notifications.
  • Graceful Hub shutdown/recovery — hub_shutdown notifications and local fallback when the server is offline.
  • Docs & website — see apps/memos-local-openclaw/HUB-SHARING-GUIDE.md and the landing/docs pages under www/.

If any specific sub-behavior is still missing, please open a focused follow-up issue rather than reopening this broad tracking issue.

shinetata avatar Jul 15 '26 03:07 shinetata