Skip to content

OpenClaw installer doesn't patch plugins.allow → plugin loads to disk but never registers; auto-capture silently no-ops #121

Description

@kaghni

Symptom

User installs @deeplake/hivemind into OpenClaw. Files land at ~/.openclaw/extensions/hivemind/ correctly. But:

  • openclaw plugins list does not show [plugins] Hivemind plugin registered
  • Auto-capture silently does nothing — no errors, no logs, just empty sessions in Deeplake
  • /hivemind_setup is unreachable (the agent can't see the command, because the plugin never registered)

Root cause

OpenClaw gates plugin loading on two allowlists in ~/.openclaw/openclaw.json:

  1. plugins.allow — controls whether the plugin is allowed to load at all
  2. tools.alsoAllow — controls whether the plugin's tools are exposed to the agent once loaded

If plugins.allow is an explicit non-empty array (the default-restrictive openclaw config), and "hivemind" is not in it, the plugin is never loadedagent_end never fires for it, so auto-capture is a no-op.

Hivemind's installer + setup helpers only handle tools.alsoAllow:

  • hivemind/src/cli/install-openclaw.ts:8-30 (installOpenclaw) drops files on disk and never touches openclaw.json.
  • hivemind/openclaw/src/setup-config.ts:33-67 (ensureHivemindAllowlisted) and :129-139 (detectAllowlistMissing) only read/write tools.alsoAllow.

This makes /hivemind_setup chicken-and-egg: the user has to add "hivemind" to plugins.allow manually before the slash command is even reachable.

Manual fix that works (reported by a user 2026-05-11)

Edit ~/.openclaw/openclaw.json:

```json
{
"plugins": { "allow": ["...", "hivemind"] },
"tools": { "alsoAllow": ["...", "hivemind"] }
}
```

Then systemctl --user restart openclaw-gateway.service. `openclaw plugins list` now shows the plugin registered. No backfill — capture starts on the next turn.

Fix (proposed for this session)

  1. install-openclaw.ts — after copying files on disk, patch ~/.openclaw/openclaw.json using openclaw's own allowlist semantics:

    • If plugins.allow is an explicit non-empty array missing \"hivemind\", append.
    • If absent / empty, leave alone (don't silently flip the user from default-allow to explicit-allowlist).
    • Same for tools.alsoAllow.
    • Atomic write (tmp + rename) with timestamped backup.
    • Print restart hint and "capture starts next turn — no backfill" caveat in installer output.
  2. openclaw/src/setup-config.ts — extend ensureHivemindAllowlisted + detectAllowlistMissing to also handle plugins.allow. Same safe semantics: only patch when it's already an explicit array.

  3. Tests — cover all edge cases:

    • plugins.allow array missing hivemind → patched
    • plugins.allow array containing hivemind → idempotent
    • plugins.allow absent → untouched
    • plugins.allow empty array [] → untouched (default-allow semantics)
    • Both arrays missing → only patch what exists
    • Restart hint present in installer success message
  4. Real-world E2E — install on a real OpenClaw gateway, send a telegram message, verify the captured turn lands in the Deeplake sessions table.

References

  • OpenClaw's own allowlist helper (the safe semantics to mirror): `ext/openclaw/src/config/plugins-allowlist.ts:7` `ensurePluginAllowlisted(cfg, pluginId)`.
  • Existing setup-config: `hivemind/openclaw/src/setup-config.ts:33-67, 129-139`.
  • Existing installer: `hivemind/src/cli/install-openclaw.ts:8-30`.
  • Existing setup-command tests: `hivemind/openclaw/tests/setup-command.test.ts` (covers only `tools.alsoAllow` today).

Test plan

  • Unit tests for both new branches of `ensureHivemindAllowlisted` and `detectAllowlistMissing` (idempotent, preserves unrelated keys, atomic w/ backup)
  • Unit tests for the installer's new openclaw.json patcher (every edge case above)
  • Source review: confirm no other code path needs the same patch
  • Local E2E: install onto a fixture openclaw config, verify both arrays patched, backup written
  • Real-world E2E on the user's openclaw gateway via telegram channel, end-to-end:
    1. Strip the manual fix (or use a fresh config)
    2. Run the new installer
    3. Restart gateway
    4. Confirm `openclaw plugins list` shows Hivemind registered
    5. Send a message through telegram
    6. Confirm the turn lands in the Deeplake sessions table

`Confidence: high` — the root cause is mechanical (missing config patch), and openclaw already exposes the correct semantics for us to mirror.

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