fix(openclaw-plugin): self-start viewer + install script improvements#1413
Merged
hijzy merged 1 commit intoMemTensor:openclaw-local-plugin-20260331from Apr 3, 2026
Conversation
…alled by host OpenClaw 4.2 loads third-party plugins via deferred reload, which runs after startPluginServices() has already executed. This means the plugin's service.start() callback (containing ViewerServer startup) is never invoked by the host. Add a 3-second setTimeout fallback in register() that self-starts the viewer if service.start() hasn't been called, ensuring the Memory Viewer (port 18799) is always accessible. Also improve install scripts: - Register plugin in slots.memory, entries, and installs of openclaw.json - Pin spec to exact resolved version to prevent auto-update triggering the OpenClaw 4.2 security scanner - Use gateway install/start (background service) instead of gateway run - Add post-install hints showing Web UI and Memory Viewer URLs Made-with: Cursor
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.
Summary
startPluginServices()has already run. This means the plugin'sservice.start()callback (which starts the ViewerServer on port 18799) is never invoked by the host. Added a 3-secondsetTimeoutfallback inregister()that self-starts the viewer if the host hasn't calledservice.start().plugins.slots.memory,plugins.entries, andplugins.installssections ofopenclaw.json, ensuring the plugin auto-loads correctly on gateway restart.@memtensor/memos-local-openclaw-plugin@1.0.7) instead of@latestin theinstalls.specfield, preventing OpenClaw 4.2's security scanner from repeatedly blocking auto-update attempts.exec npx openclaw gateway run(foreground, blocks shell) withnpx openclaw gateway install/start(background launchd service), so the script exits cleanly.Test plan
memos-local: service.start() not called by host, self-starting viewer...curl -sI http://localhost:18799returns HTTP 200install.ps1on WindowsMade with Cursor