Skip to content

Bug: migrate/scan hardcodes ~/.openclaw, ignores OPENCLAW_STATE_DIR in multi-profile deployments #1234

@xxjj1111

Description

@xxjj1111

Plugin Version

@memtensor/memos-local-openclaw-plugin v1.0.2

Problem

When OpenClaw runs with a non-default profile (e.g. OPENCLAW_STATE_DIR=~/.openclaw-family-doctor), the MemOS Memory Viewer's migrate/scan feature always scans ~/.openclaw (hardcoded), ignoring the actual OPENCLAW_STATE_DIR.

Steps to Reproduce

  1. Start OpenClaw with a non-default profile: OPENCLAW_STATE_DIR=~/.openclaw-family-doctor, viewer port 19002
  2. Open Viewer at http://localhost:19002
  3. Click the Scan / Migrate button
  4. Observe: scan results show memories from ~/.openclaw/memos-local/memos.db (~6000 records) instead of the current profile's DB (~800 records)

Root Cause

In dist/src/viewer/server.js and dist/viewer/server.js:

getOpenClawHome() {
    const home = process.env.HOME || process.env.USERPROFILE || "";
    return path.join(home, ".openclaw"); // hardcoded!
}

Fix

return process.env.OPENCLAW_STATE_DIR || path.join(home, ".openclaw");

Impact

In a dual-bot setup, clicking Scan in the secondary bot Viewer shows the primary bot 6000+ memories. If user clicks Import, memories cross-contaminate between bots.

Environment

  • @memtensor/memos-local-openclaw-plugin v1.0.2
  • OpenClaw v2026.3.13, macOS Darwin 25.3.0 arm64
  • Dual-profile: main bot ~/.openclaw (port 18789), secondary bot ~/.openclaw-family-doctor (port 19001)

Metadata

Metadata

Assignees

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