Repository navigation
Description
Bug Report: ctx.registerTools() never called when loaded via QClaw desktop app
Environment
- Plugin:
@memtensor/memos-local-openclaw-pluginv1.0.10 - OpenClaw: QClaw desktop app (Windows, user
susu) - OpenClaw CLI:
openclaw gateway start(works correctly) - Platform: hermes-hub teamToken:
hermes-hub-2026, server:http://192.168.0.66:18912
Problem
When memos-local is loaded via the QClaw desktop app, the Hub connection is never established and ctx.registerTools() is never called — meaning Gateway JSON-RPC tools are unavailable.
Symptoms:
openclaw gateway call tools.list→{"error":{"code":-32601,"message":"unknown method: tools.list"}}- Hub Server logs show zero incoming connections from the QClaw machine
- Local memory (SQLite) initializes and works correctly
Note: This works correctly when loaded via openclaw gateway start (OpenClaw CLI), but fails when loaded via the QClaw desktop application.
Root Cause
In apps/memos-local-openclaw/index.ts, the startServiceCore() function — which calls both connectToHub() and ctx.registerTools() — is gated behind isGatewayStartCommand():
if (isGatewayStartCommand()) {
await startServiceCore(ctx);
}isGatewayStartCommand() checks process.argv for gateway or daemon keywords. The QClaw desktop app loads plugins with a different argv context that does not contain these keywords, causing the gate to return false and skipping both Hub connection and tool registration entirely.
Impact
- Team memory sharing is completely non-functional for QClaw users
- Gateway JSON-RPC tools are unavailable
- Local memory works, but the Hub role is inaccessible
Proposed Fix
Separate the isGatewayStartCommand() gate so that:
- Hub connection — happens whenever the plugin loads, regardless of startup method
- Gateway tool registration — stays gated behind
isGatewayStartCommand()since it requires the Gateway to be running
Alternative: Add a config flag like sharing.hub.connectOnLoad: true to allow Hub connection without requiring openclaw gateway start.
Reproduction Steps
QClaw (broken):
- Install memos-local plugin in QClaw
- Configure
sharingin~/.openclaw/plugins/memos-local/openclaw.json - Run
openclaw gateway call tools.list→unknown method: tools.list
OpenClaw CLI (works):
- Same plugin + config
- Run
openclaw gateway start→ tools.list works, Hub connection established
Related Code
apps/memos-local-openclaw/index.ts—isGatewayStartCommand()gate at line ~2452apps/memos-local-openclaw/index.ts—startServiceCore()callsconnectToHub()andctx.registerTools()apps/memos-local-openclaw/src/client/connector.ts—connectToHub()implementation
Reported via Hermes Agent (沈静雯) on behalf of the Hermes/OpenClaw team.
Activity
Memtensor-AI commentedon May 28, 2026
✅ AutoDev task
0ef34b84dd0ba786completed.Summary: 已修复 Issue #1612:将 Hub 客户端连接拆出 startServiceCore,新增 connectClientToHubIfNeeded 幂等帮手,在 register() 末尾立即 fire-and-forget 触发,让 QClaw 桌面端等不走 service.start() 的宿主也能连上 Hub Server。新增 4 个 vitest 用例覆盖 eager 连接、关闭/角色判断、与 service.start() 的幂等性;相关 lifecycle/wiring 既有用例全部通过(剩余 4 个失败用例是 ONNX 模型加载和 task-processor 等历史问题,与本 PR 无关)。提交 a645ddd,已 push 到 autodev/MemOS-1612。
Base branch:
v2.0.16Branch:
autodev/MemOS-1612Commit:
a645dddPR: #1825
Assigned to: @CarltonXiang, @syzsunshine219
Reviewers: @CarltonXiang, @syzsunshine219
Memtensor-AI commentedon Jun 4, 2026
🤖 AutoDev has picked up this issue and started working on it.
Task ID:
0f3bfa68d40d4cf8Working branch:
autodev/MemOS-1612Target branch:
mainWorkflow: opsp (analysis → coding → testing → PR)
I will post the PR link here once done. If I need more information, I will ask in the comments.
fix(memos-local-openclaw): connect to Hub on plugin load (QClaw desktop)
Memtensor-AI commentedon Jun 4, 2026
🚀 AutoDev task
0f3bfa68d40d4cf8pushed commit.Summary: Successfully fixed bug #1612: QClaw desktop app Hub connection issue in memos-local-openclaw plugin.
Root Cause:
The QClaw desktop app loads the memos-local-openclaw plugin without calling
service.start(), which meantconnectToHub()insidestartServiceCore()never ran. This caused the Hub Server to see zero incoming connections from QClaw desktop users, making team sharing completely non-functional even though local memory worked fine.Solution Implemented:
Cherry-picked and applied fix from commit a645ddd that splits the Hub client connection logic out of
startServiceCore()into an idempotent helper functionconnectClientToHubIfNeeded(). This helper is now called eagerly at the end of theregister()function, independent of the host's service lifecycle.Key Changes:
connectClientToHubIfNeeded()function with idempotency guard to prevent duplicate connection attemptsstartServiceCore()with call to the helperregister()function to handle QClaw desktop app casetests/hub-eager-connect.test.tswith 224 lines of regression testsFiles Modified:
apps/memos-local-openclaw/index.ts(42 line changes: +34 insertions, -8 deletions)apps/memos-local-openclaw/tests/hub-eager-connect.test.ts(224 lines, new file)Note on Issue Title:
The issue title mentions "ctx.registerTools() never called" but this was a misnomer. The actual problem was Hub client connection initialization, not tool registration. The plugin correctly uses OpenClaw Plugin SDK's
api.registerTool()pattern throughout.Base branch:
mainBranch:
autodev/MemOS-1612Commit:
db3e0bfI will create the PR next and post the PR link here.
Memtensor-AI commentedon Jun 4, 2026
✅ AutoDev task
0f3bfa68d40d4cf8completed.Summary: Successfully fixed bug #1612: QClaw desktop app Hub connection issue in memos-local-openclaw plugin.
Root Cause:
The QClaw desktop app loads the memos-local-openclaw plugin without calling
service.start(), which meantconnectToHub()insidestartServiceCore()never ran. This caused the Hub Server to see zero incoming connections from QClaw desktop users, making team sharing completely non-functional even though local memory worked fine.Solution Implemented:
Cherry-picked and applied fix from commit a645ddd that splits the Hub client connection logic out of
startServiceCore()into an idempotent helper functionconnectClientToHubIfNeeded(). This helper is now called eagerly at the end of theregister()function, independent of the host's service lifecycle.Key Changes:
connectClientToHubIfNeeded()function with idempotency guard to prevent duplicate connection attemptsstartServiceCore()with call to the helperregister()function to handle QClaw desktop app casetests/hub-eager-connect.test.tswith 224 lines of regression testsFiles Modified:
apps/memos-local-openclaw/index.ts(42 line changes: +34 insertions, -8 deletions)apps/memos-local-openclaw/tests/hub-eager-connect.test.ts(224 lines, new file)Note on Issue Title:
The issue title mentions "ctx.registerTools() never called" but this was a misnomer. The actual problem was Hub client connection initialization, not tool registration. The plugin correctly uses OpenClaw Plugin SDK's
api.registerTool()pattern throughout.Base branch:
mainBranch:
autodev/MemOS-1612Commit:
db3e0bfPR: #1880
Assigned to: @MatthewZhuang, @CarltonXiang, @syzsunshine219
Reviewers: @MatthewZhuang, @CarltonXiang, @syzsunshine219
Fix #1612: [Bug] memos-local-openclaw-plugin: ctx.registerTools() nev…
hijzy commentedon Jun 12, 2026
Thanks for the detailed report.
This issue was reported against the v1 plugin,
@memtensor/memos-local-openclaw-plugin. The v1 plugin has been deprecated and is no longer maintained.Please migrate to the v2 plugin:
@memtensor/memos-local-plugin. The v2 plugin supports both OpenClaw and Hermes, and is the currently maintained implementation.If the same issue still reproduces with
@memtensor/memos-local-plugin, please open a new issue with the v2 plugin version, config, reproduction steps, and relevant logs.Closing this as obsolete for the v1 plugin.
感谢反馈。
这个问题是基于 v1 插件
@memtensor/memos-local-openclaw-plugin提出的。v1 插件已废弃,并且不再维护。请迁移到 v2 插件:
@memtensor/memos-local-plugin。v2 插件同时支持 OpenClaw 和 Hermes,是当前维护中的实现。如果在
@memtensor/memos-local-plugin中仍然可以复现同样的问题,请重新提交一个 issue,并附上 v2 插件版本、配置、复现步骤和相关日志。因此这个 issue 将作为 v1 插件的过期问题关闭。