Skip to content

Bug: doctor --fix does not clean up plugins.slots.* when plugin is missing, leaving config unrecoverable #76550

Description

@slideshow-dingo

Summary

openclaw doctor --fix correctly removes stale entries from plugins.allow[] and plugins.entries{} when a plugin is not found, but does not clean up plugins.slots.* references. A stale plugins.slots.<slot> reference causes a hard config validation failure — the entire config is rejected as invalid, and the gateway cannot start. The doctor reports "Repaired missing configured plugin" but leaves the slot untouched, so the user believes it was fixed when nothing actually changed.

This is a higher-severity gap than the existing #65293 (channel reference cleanup) because slot references are fatal to startup, whereas stale plugins.allow / plugins.entries entries are soft warnings only.

Steps to Reproduce

  1. Configure a plugin in plugins.slots.memory (e.g. "openclaw-honcho")
  2. Delete the plugin files from disk: rm -rf ~/.openclaw/npm/node_modules/@honcho-ai/openclaw-honcho
  3. Run openclaw doctor --fix
  4. Doctor reports "Repaired missing configured plugin" and installs/reinstalls the package
  5. On a subsequent run, doctor may remove the plugin from plugins.allow[] and plugins.entries{} (treating them as stale) while plugins.slots.memory still references it
  6. Run openclaw config validate — fails with:
    plugins.slots.memory: plugin not found: openclaw-honcho
    
  7. Gateway cannot start. Running doctor again gives the same "repaired" message but the slot is still stale — unrecoverable loop.

Actual Behavior

Expected Behavior

doctor --fix should either:

  • Remove the stale plugins.slots.<slot> entry when the referenced plugin is not found and cannot be installed, or
  • Keep the plugin in plugins.allow[] and plugins.entries{} when plugins.slots.* still references it (treat the slot as authoritative), or
  • At minimum, warn that slots still reference a missing plugin instead of claiming repair success

Root Cause Analysis

The stale-entry cleanup logic in doctor treats plugins.slots.* differently from plugins.allow[] and plugins.entries{}. Slot values are validated at startup (hard error) but not cleaned up during doctor repair. Additionally, when doctor removes entries from plugins.allow[] and plugins.entries{} while a slot still references the same plugin, it creates a contradictory config that can never validate.

Environment

  • OpenClaw: 2026.5.2 (8b2a6e5)
  • OS: Ubuntu 24.04, Linux x86_64, Node 24
  • Install: npm global + systemd-managed gateway
  • Plugin: @honcho-ai/openclaw-honcho 1.4.1

Impact

Users who lose plugin files on disk (npm registry issues, accidental deletion, #76441 wipe) cannot recover via doctor --fix and must manually edit openclaw.json to remove the slot reference. The misleading "repaired" message wastes debugging time.

Related Issues


AI-assisted disclosure: this bug report was drafted with AI assistance based on observed failure mode during gateway troubleshooting.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions