Fix #1612: [Bug] memos-local-openclaw-plugin: ctx.registerTools() never called in QClaw des#1880
Merged
Merged
Conversation
The QClaw desktop app loads this plugin without calling service.start(), which used to mean connectToHub() inside startServiceCore() never ran. The Hub Server saw zero incoming connections from QClaw users and team sharing was completely non-functional, even though local memory worked. Split the client-side Hub connection out of startServiceCore() into a small idempotent helper and fire it eagerly at the end of register(), independent of the host's service lifecycle. The gateway CLI path still calls it via service.start() and the guard prevents a duplicate attempt. Fixes #1612 Cherry-picked from commit a645ddd
Collaborator
Author
✅ Automated Test Results: PASSEDAll tests passed (35/35 executed, 36 skipped). memos_local_plugin/smoke: 0 passed, 1 skipped, memos_local_plugin/contract: 35 passed, 35 skipped. Duration: 4s Branch: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
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.Related Issue (Required): Fixes #1612
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Executor did not report tests.
Checklist
@MatthewZhuang, @CarltonXiang, @syzsunshine219 please review this PR.
Reviewer Checklist