Skip to content

fix(openclaw-plugin): self-start viewer + install script improvements#1413

Merged
hijzy merged 1 commit intoMemTensor:openclaw-local-plugin-20260331from
hijzy:fix/openclaw-plugin-viewer-selfstart
Apr 3, 2026
Merged

fix(openclaw-plugin): self-start viewer + install script improvements#1413
hijzy merged 1 commit intoMemTensor:openclaw-local-plugin-20260331from
hijzy:fix/openclaw-plugin-viewer-selfstart

Conversation

@hijzy
Copy link
Copy Markdown
Collaborator

@hijzy hijzy commented Apr 3, 2026

Summary

  • Viewer self-start fallback: OpenClaw 4.2 loads third-party plugins via deferred reload after startPluginServices() has already run. This means the plugin's service.start() callback (which starts the ViewerServer on port 18799) is never invoked by the host. Added a 3-second setTimeout fallback in register() that self-starts the viewer if the host hasn't called service.start().
  • Install script: full plugin registration: Register the plugin in plugins.slots.memory, plugins.entries, and plugins.installs sections of openclaw.json, ensuring the plugin auto-loads correctly on gateway restart.
  • Install script: pin version spec: Use the exact resolved version (e.g. @memtensor/memos-local-openclaw-plugin@1.0.7) instead of @latest in the installs.spec field, preventing OpenClaw 4.2's security scanner from repeatedly blocking auto-update attempts.
  • Install script: background service: Replace exec npx openclaw gateway run (foreground, blocks shell) with npx openclaw gateway install/start (background launchd service), so the script exits cleanly.
  • Install script: completion hints: Print OpenClaw Web UI and Memory Viewer URLs after successful installation.

Test plan

  • Verified on macOS with OpenClaw 2026.4.2 — Memory Viewer starts on port 18799
  • Confirmed self-start log: memos-local: service.start() not called by host, self-starting viewer...
  • Confirmed curl -sI http://localhost:18799 returns HTTP 200
  • Test install.ps1 on Windows

Made with Cursor

…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
@hijzy hijzy merged commit dac3bbf into MemTensor:openclaw-local-plugin-20260331 Apr 3, 2026
@hijzy hijzy deleted the fix/openclaw-plugin-viewer-selfstart branch April 8, 2026 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant