Skip to content

[Bug] Memory Viewer starts twice on OpenClaw startup (port 18799 → 18800 fallback) #1422

@prospect1314521

Description

@prospect1314521

Bug Description

When starting OpenClaw with the memos-local-openclaw-plugin, the Memory Viewer service is initialized twice, causing a port conflict.

Observed Behavior

  1. First startup (when OpenClaw gateway starts):

    07:41:15 [plugins] MemOS Memory Viewer → http://127.0.0.1:18799
    07:41:15 [plugins] memos-local: password reset token: bd6c755f...
    
  2. Second startup (when sending the first message/conversation):

    07:42:16 [plugins] memos-local: service.start() not called by host, self-starting viewer...
    07:42:16 [plugins] Viewer port 18799 in use, trying 18800
    07:42:17 [plugins] MemOS Memory Viewer → http://127.0.0.1:18800
    

Impact

  • Does not break functionality: The plugin correctly falls back to port 18800, so memory features still work.
  • Confusing logs: Users see two different Viewer URLs and two different password reset tokens.
  • Resource waste: Two instances of the Viewer server are running unnecessarily.

Expected Behavior

The Memory Viewer should only start once during OpenClaw initialization. The second initialization triggered by the first conversation should be skipped if the service is already running.

Environment

  • OpenClaw version: 2026.4.2
  • memos-local-openclaw-plugin version: 1.0.8
  • OS: Windows
  • Configuration: plugins.slots.memory + plugins.allow both include the plugin

Possible Cause

The plugin might be registered/loaded twice due to overlapping configuration triggers (plugins.allow + plugins.slots.memory), or the service.start() lifecycle hook is not properly checking if the viewer is already running before attempting to start it again.

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