Skip to content

[Bug] mindkeeper-openclaw 0.3.2 init overwrites openclaw.json during Gateway startup, triggering config protection #1

@shangfangbao

Description

@shangfangbao

Body:

Bug Description

Plugin version: mindkeeper-openclaw 0.3.2
OpenClaw version: 2026.4.9
Node.js: >= 22

When mindkeeper-openclaw is installed and the Gateway starts, the plugin's
initialization process modifies openclaw.json in a way that triggers
OpenClaw's config protection mechanism, causing the config to be overwritten
with a minimal 256-byte version.

Steps to Reproduce

  1. Install mindkeeper-openclaw via openclaw plugins install mindkeeper-openclaw
  2. Ensure a working openclaw.json with full configuration (~5000+ bytes) exists
  3. Start the Gateway: systemctl --user start openclaw-gateway
  4. Gateway detects config change during mindkeeper init
  5. Config is overwritten to 256 bytes

Expected Behavior

The plugin should initialize without modifying the openclaw.json file,
or should make changes that don't trigger the config protection mechanism.

Actual Behavior

During Gateway startup, mindkeeper's initialization causes these log entries:

[plugins] [mindkeeper] Plugin loaded.
Config overwrite: openclaw.json (sha256 ... -> ..., backup=...)
Config write anomaly: openclaw.json (size-drop:5347->349, gateway-mode-removed)
Config overwrite: openclaw.json (sha256 ... -> ..., backup=...)
Config write anomaly: openclaw.json (size-drop:5347->256, gateway-mode-removed)

The Gateway's "config protection" mechanism detects a size-drop and
overwrites with minimal config, causing a restart loop.

Environment

  • OpenClaw: 2026.4.9
  • mindkeeper-openclaw: 0.3.2
  • OS: Linux (WSL2)
  • Config before start: 5347 bytes (local mode, full config)
  • Config after triggered: 256 bytes (minimal stub)

Possible Cause

mindkeeper's init() or watcher initialization may be writing to openclaw.json
(perhaps updating state, timestamps, or tracked file indices). This modifies
the config in a way that OpenClaw's protection mechanism interprets as a threat.

Workaround Attempted

Pre-adding the mindkeeper plugin entries to openclaw.json before running
openclaw plugins install did not prevent the issue. The problem occurs
during Gateway startup when mindkeeper initializes.

Config after failure

After the loop stabilizes, openclaw.json contains only:

{
  "tools": { "alsoAllow": [...] },
  "meta": { "lastTouchedVersion": "2026.4.9", ... }
}

All gateway, agents, bindings, and other critical sections are removed.

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