Skip to content

[Bug] memos-local-openclaw-plugin: ctx.registerTools() never called in QClaw desktop app context #1612

@buchicao-star

Description

@buchicao-star

Bug Report: ctx.registerTools() never called when loaded via QClaw desktop app

Environment

  • Plugin: @memtensor/memos-local-openclaw-plugin v1.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:

  1. Hub connection — happens whenever the plugin loads, regardless of startup method
  2. 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):

  1. Install memos-local plugin in QClaw
  2. Configure sharing in ~/.openclaw/plugins/memos-local/openclaw.json
  3. Run openclaw gateway call tools.listunknown method: tools.list

OpenClaw CLI (works):

  1. Same plugin + config
  2. Run openclaw gateway start → tools.list works, Hub connection established

Related Code

  • apps/memos-local-openclaw/index.tsisGatewayStartCommand() gate at line ~2452
  • apps/memos-local-openclaw/index.tsstartServiceCore() calls connectToHub() and ctx.registerTools()
  • apps/memos-local-openclaw/src/client/connector.tsconnectToHub() implementation

Reported via Hermes Agent (沈静雯) on behalf of the Hermes/OpenClaw team.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions